@@ -48,26 +48,28 @@ jobs:
4848 username : ${{ secrets.DOCKERHUB_USERNAME }}
4949 password : ${{ secrets.DOCKERHUB_TOKEN }}
5050
51- - name : Build and push
51+ - name : Production Build and push
52+ if : contains(github.ref, "main")
5253 uses : docker/build-push-action@v2
5354 with :
5455 context : .
5556 push : true
56- tags : ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_IMAGE_NAME }}:${{steps.vars.outputs.tag}}
57+ tags : ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_IMAGE_NAME }}:latest
5758 platforms : linux/amd64,linux/arm/v7,linux/arm64/v8
5859 cache-from : type=local,src=/tmp/.buildx-cache
5960 cache-to : type=local,dest=/tmp/.buildx-cache-new
6061
61- - name : Build and push
62+ - name : Development Build and push
63+ if : contains(github.ref, "develop")
6264 uses : docker/build-push-action@v2
6365 with :
6466 context : .
6567 push : true
66- tags : ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_IMAGE_NAME }}:latest
68+ tags : ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_IMAGE_NAME }}:develop
6769 platforms : linux/amd64,linux/arm/v7,linux/arm64/v8
6870 cache-from : type=local,src=/tmp/.buildx-cache
69- cache-to : type=local,dest=/tmp/.buildx-cache-new
70-
71+ cache-to : type=local,dest=/tmp/.buildx-cache-new
72+
7173 - name : Move cache
7274 run : |
7375 rm -rf /tmp/.buildx-cache
0 commit comments