From ab9c147c6dfc3be18128b9c8605bb8b304ad54e6 Mon Sep 17 00:00:00 2001 From: Eric Radman Date: Thu, 26 Dec 2024 21:19:32 -0500 Subject: [PATCH] Create workflow trigger for publishing release image (#7259) Co-authored-by: Justin Clift --- .github/workflows/preview-image.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/preview-image.yml b/.github/workflows/preview-image.yml index 8ac42b5a6a..6a14a2cfc5 100644 --- a/.github/workflows/preview-image.yml +++ b/.github/workflows/preview-image.yml @@ -4,6 +4,15 @@ on: tags: - '*-dev' workflow_dispatch: + inputs: + dockerRepository: + description: 'Docker repository' + required: true + default: 'preview' + type: choice + options: + - preview + - redash env: NODE_VERSION: 18 @@ -75,6 +84,7 @@ jobs: # TODO: We can use GitHub Actions's matrix option to reduce the build time. - name: Build and push preview image to Docker Hub uses: docker/build-push-action@v4 + if: ${{ github.event.inputs.dockerRepository == 'preview' || !github.event.workflow_run }} with: push: true tags: | @@ -89,6 +99,22 @@ jobs: env: DOCKER_CONTENT_TRUST: true + - name: Build and push release image to Docker Hub + uses: docker/build-push-action@v4 + if: ${{ github.event.inputs.dockerRepository == 'redash' }} + with: + push: true + tags: | + redash/redash:${{ steps.version.outputs.VERSION_TAG }} + context: . + build-args: | + test_all_deps=true + cache-from: type=gha,scope=multi-platform + cache-to: type=gha,mode=max,scope=multi-platform + platforms: linux/amd64,linux/arm64 + env: + DOCKER_CONTENT_TRUST: true + - name: "Failure: output container logs to console" if: failure() run: docker compose logs