@@ -20,29 +20,55 @@ jobs:
2020 exit 1
2121 fi
2222
23- retag-images :
23+ docker-backend :
2424 runs-on : ubuntu-latest
2525 needs : [validate-tag]
26- strategy :
27- matrix :
28- image : [backend, frontend]
2926 steps :
27+ - uses : actions/checkout@v5
28+ - uses : docker/setup-buildx-action@v3
3029 - uses : docker/login-action@v3
3130 with :
3231 registry : ghcr.io
3332 username : ${{ github.actor }}
3433 password : ${{ secrets.GITHUB_TOKEN }}
35- - name : Re-tag ${{ matrix.image }} image with release version
36- run : |
37- SRC="ghcr.io/${{ github.repository }}/${{ matrix.image }}:${{ github.sha }}"
38- DST="ghcr.io/${{ github.repository }}/${{ matrix.image }}:${{ github.event.release.tag_name }}"
39- docker pull "$SRC"
40- docker tag "$SRC" "$DST"
41- docker push "$DST"
34+ - uses : docker/build-push-action@v6
35+ with :
36+ context : .
37+ file : backend/Dockerfile
38+ push : true
39+ platforms : linux/amd64
40+ tags : |
41+ ghcr.io/${{ github.repository }}/backend:${{ github.event.release.tag_name }}
42+ ghcr.io/${{ github.repository }}/backend:${{ github.sha }}
43+ cache-from : type=gha
44+ cache-to : type=gha,mode=max
45+
46+ docker-frontend :
47+ runs-on : ubuntu-latest
48+ needs : [validate-tag]
49+ steps :
50+ - uses : actions/checkout@v5
51+ - uses : docker/setup-buildx-action@v3
52+ - uses : docker/login-action@v3
53+ with :
54+ registry : ghcr.io
55+ username : ${{ github.actor }}
56+ password : ${{ secrets.GITHUB_TOKEN }}
57+ - uses : docker/build-push-action@v6
58+ with :
59+ context : .
60+ file : frontend/Dockerfile
61+ push : true
62+ platforms : linux/amd64
63+ tags : |
64+ ghcr.io/${{ github.repository }}/frontend:${{ github.event.release.tag_name }}
65+ ghcr.io/${{ github.repository }}/frontend:${{ github.sha }}
66+ cache-from : type=gha
67+ cache-to : type=gha,mode=max
4268
4369 deploy :
4470 runs-on : ubuntu-latest
45- needs : [retag-images ]
71+ needs : [docker-backend, docker-frontend ]
4672 steps :
4773 - uses : actions/checkout@v5
4874 with :
0 commit comments