File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change 3838 fail_ci_if_error : true
3939
4040 build :
41- if : github.ref == 'refs/heads/main'
41+ if : startsWith( github.ref, 'refs/tags/')
4242 runs-on : ubuntu-latest
4343 needs : coverage
4444 steps :
@@ -53,11 +53,16 @@ jobs:
5353 - name : Add SHORT_SHA env property with commit short sha
5454 run : echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV
5555
56+ - name : Docker Tag
57+ id : vars
58+ run : echo ::set-output name=tag::${GITHUB_REF/refs\/tags\//}
59+
5660 - name : Build the Docker image
57- run : docker build . --file Dockerfile --tag jarpsimoes/git_http_server:v0.${SHORT_SHA}
61+ run : |
62+ docker build . --file Dockerfile --tag jarpsimoes/git_http_server:${{ steps.vars.outputs.tag }}
63+ docker tag jarpsimoes/git_http_server:${{ steps.vars.outputs.tag }} jarpsimoes/git_http_server:latest
5864
5965 - name : Push Image
60- run : docker push jarpsimoes/git_http_server:v0.${SHORT_SHA}
61-
62- - name : Push Latest
63- run : docker tag jarpsimoes/git_http_server:v0.${SHORT_SHA} jarpsimoes/git_http_server:latest && docker push jarpsimoes/git_http_server:latest
66+ run : |
67+ docker push jarpsimoes/git_http_server:${{ steps.vars.outputs.tag }}
68+ docker push jarpsimoes/git_http_server:latest
You can’t perform that action at this time.
0 commit comments