File tree Expand file tree Collapse file tree 1 file changed +9
-20
lines changed
Expand file tree Collapse file tree 1 file changed +9
-20
lines changed Original file line number Diff line number Diff line change 22
33on :
44 push :
5- branches : [ "main" ]
6- tags : [ "*" ]
5+ tags :
6+ - ' * ' # Runs only when a tag is pushed
77
88jobs :
99 build :
@@ -19,31 +19,20 @@ jobs:
1919 remove-android : ' true'
2020 remove-haskell : ' true'
2121 remove-codeql : ' true'
22- remove-docker-images : ' true'
23- overprovision-lvm : ' true'
2422
2523 - uses : actions/checkout@v4
26- - name : Inspect Disk Space
27- run : df -h
28- - name : Prune Docker
29- run : docker system prune -af
30- - uses : actions/checkout@v4
31-
32- - name : Set image tag
33- id : vars
34- run : echo "SHORT_SHA=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT
3524
3625 - name : Login to Docker Hub
3726 run : echo "${{ secrets.GH_DOCKERHUB }}" | docker login -u fnzv --password-stdin
3827
39- - name : Build image
28+ - name : Build and Push image
4029 run : |
30+ TAG_NAME=${{ github.ref_name }}
31+
4132 docker build \
42- -t fnzv/trash:${{ steps.vars.outputs.SHORT_SHA } } \
33+ -t fnzv/trash:${TAG_NAME } \
4334 -t fnzv/trash:latest \
4435 .
45-
46- - name : Push image
47- run : |
48- docker push fnzv/trash:${{ steps.vars.outputs.SHORT_SHA }}
49- docker push fnzv/trash:latest
36+
37+ docker push fnzv/trash:${TAG_NAME}
38+ docker push fnzv/trash:latest
You can’t perform that action at this time.
0 commit comments