Skip to content

Commit

Permalink
Create workflow trigger for publishing release image
Browse files Browse the repository at this point in the history
- If the action was not triggered manually, publish a preview image
- Always select a branch for release image
  • Loading branch information
eradman committed Dec 24, 2024
1 parent d884da2 commit 2bb3770
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions .github/workflows/preview-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -75,11 +84,28 @@ 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: |
redash/redash:preview
redash/preview:${{ steps.version.outputs.VERSION_TAG }}
eradman/redash:preview
eradman/preview:${{ 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: Build and push release image to Docker Hub
uses: docker/build-push-action@v4
if: ${{ github.event.inputs.dockerRepository == 'redash' }}
with:
push: true
tags: |
eradman/redash:${{ steps.version.outputs.VERSION_TAG }}
context: .
build-args: |
test_all_deps=true
Expand Down

0 comments on commit 2bb3770

Please sign in to comment.