Skip to content

Commit dac8296

Browse files
committed
Clean up tagging of containers
Signed-off-by: Nobuhiro MIKI <nob@bobuhiro11.net>
1 parent fa0aa97 commit dac8296

1 file changed

Lines changed: 6 additions & 11 deletions

File tree

.github/workflows/action.yaml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,12 @@ jobs:
6464
with:
6565
username: ${{ secrets.DOCKERHUB_USERNAME }}
6666
password: ${{ secrets.DOCKERHUB_TOKEN }}
67-
- name: Push to Docker Hub for PR
68-
if: github.ref != 'refs/heads/main' && github.event_name != 'schedule'
67+
- name: Push to Docker Hub
68+
if: github.event_name != 'schedule'
69+
env:
70+
tag: "${{ github.ref == 'refs/heads/main' && 'latest' || github.sha }}"
6971
run: |
7072
for c in controller compute-1 compute-2; do
71-
docker commit $c bobuhiro11/containerized-devstack-$c:${{ github.sha }}
72-
docker push bobuhiro11/containerized-devstack-$c:${{ github.sha }}
73-
done
74-
- name: Push to Docker Hub for latest
75-
if: github.ref == 'refs/heads/main' && github.event_name != 'schedule'
76-
run: |
77-
for c in controller compute-1 compute-2; do
78-
docker commit $c bobuhiro11/containerized-devstack-$c:latest
79-
docker push bobuhiro11/containerized-devstack-$c:latest
73+
docker commit $c bobuhiro11/containerized-devstack-$c:$tag
74+
docker push bobuhiro11/containerized-devstack-$c:$tag
8075
done

0 commit comments

Comments
 (0)