File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 4141 sarif_file : ' trivy-results.sarif'
4242
4343 - name : Login to Docker Hub
44- if : github.ref == 'refs/heads/master' && github.event_name == 'push'
4544 uses : docker/login-action@v1
4645 with :
4746 username : ${{ secrets.DOCKERHUB_USERNAME }}
5251 run : |-
5352 docker push $IMAGE_NAME:latest
5453
54+ - name : Set tag in environment
55+ if : contains(github.ref, 'refs/tags/')
56+ run : echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
57+
5558 - name : Push tagged image
56- if : contains(github.ref, 'refs/tags/v ')
59+ if : contains(github.ref, 'refs/tags/')
5760 run : |-
58- docker push $IMAGE_NAME:$GITHUB_TAG
61+ docker tag $IMAGE_NAME:${{ github.sha }} $IMAGE_NAME:$RELEASE_VERSION
62+ docker push $IMAGE_NAME:$RELEASE_VERSION
You can’t perform that action at this time.
0 commit comments