Skip to content

Commit c3809ea

Browse files
working github action workflows (#42)
* cleanup of dev branch * changed if statement * added tag build
1 parent 0b76840 commit c3809ea

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

.github/workflows/docker-build.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
password: ${{ secrets.DOCKERHUB_TOKEN }}
5050

5151
- name: Production Build and push
52-
if: contains(github.ref, "main")
52+
if: ${{ github.ref == 'refs/heads/main' }}
5353
uses: docker/build-push-action@v2
5454
with:
5555
context: .
@@ -59,8 +59,19 @@ jobs:
5959
cache-from: type=local,src=/tmp/.buildx-cache
6060
cache-to: type=local,dest=/tmp/.buildx-cache-new
6161

62+
- name: Production Tag Build and push
63+
if: startsWith(github.ref, 'refs/tags/v')
64+
uses: docker/build-push-action@v2
65+
with:
66+
context: .
67+
push: true
68+
tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_IMAGE_NAME }}:${{ github.event.ref }}
69+
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8
70+
cache-from: type=local,src=/tmp/.buildx-cache
71+
cache-to: type=local,dest=/tmp/.buildx-cache-new
72+
6273
- name: Development Build and push
63-
if: contains(github.ref, "develop")
74+
if: ${{ github.ref == 'refs/heads/develop' }}
6475
uses: docker/build-push-action@v2
6576
with:
6677
context: .

0 commit comments

Comments
 (0)