From fe2178e9460c77f33bd91e25762d6c78bf009cf4 Mon Sep 17 00:00:00 2001 From: Robert Eggl Date: Mon, 30 Dec 2024 01:47:40 +0100 Subject: [PATCH] ci: update deployment triggers to include tag pushes --- .github/workflows/deploy-docs.yml | 3 ++- .github/workflows/deploy-webapp.yml | 14 ++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index bc765e0e..a81e0c32 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -3,7 +3,8 @@ name: Build and push Docker image for docs # Configures this workflow to run every time a change is pushed to the branch called `release`. on: push: - branches: ['main'] + tags: + - '*' paths: - 'docs/**' diff --git a/.github/workflows/deploy-webapp.yml b/.github/workflows/deploy-webapp.yml index e7a3904a..dbe3d8ac 100644 --- a/.github/workflows/deploy-webapp.yml +++ b/.github/workflows/deploy-webapp.yml @@ -1,9 +1,11 @@ name: Create and publish a Docker image -# Configures this workflow to run every time a change is pushed to the branch called `release`. +# Configures this workflow to run on push to the develop branch and on tag creation. on: push: - branches: ['main', 'develop'] + branches: ['develop'] + tags: + - '*' # Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds. env: @@ -20,7 +22,6 @@ jobs: contents: read attestations: write packages: write - # steps: - name: Checkout repository uses: actions/checkout@v4 @@ -41,12 +42,13 @@ jobs: # It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository. # It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step. - name: Build and push Docker image - id: push - uses: docker/build-push-action@v5.0.0 + uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 with: context: . push: true - tags: ${{ steps.meta.outputs.tags }} + tags: | + ${{ steps.meta.outputs.tags }} + ${{ !startsWith(github.ref, 'refs/tags/') && 'develop' || 'release' }} labels: ${{ steps.meta.outputs.labels }} build-args: | EXPO_PUBLIC_THI_API_KEY=${{ secrets.EXPO_PUBLIC_THI_API_KEY }}