From 997a3ac73ff40657a87a2beec0d93309130faf8b Mon Sep 17 00:00:00 2001 From: Glenn de Haan Date: Sat, 23 Mar 2024 18:02:03 +0100 Subject: [PATCH] Allow tag based deployments --- .github/workflows/publish.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 543d284..6a45b70 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -6,6 +6,8 @@ on: push: branches: - 'master' + tags: + - '*' jobs: docker: @@ -23,7 +25,14 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push - id: docker_build + if: startsWith(github.ref, 'refs/tags/') + uses: docker/build-push-action@v2 + with: + platforms: linux/amd64,linux/arm64 + push: true + tags: glenndehaan/unifi-voucher-site:${{ github.ref_name }} + - name: Build and push (latest) + if: github.ref == 'refs/heads/master' uses: docker/build-push-action@v2 with: platforms: linux/amd64,linux/arm64