Skip to content

Commit b9583c0

Browse files
eradmanjustinclift
andauthored
Create workflow trigger for publishing release image (#7259)
Co-authored-by: Justin Clift <justin@postgresql.org>
1 parent 89d7f54 commit b9583c0

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.github/workflows/preview-image.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ on:
44
tags:
55
- '*-dev'
66
workflow_dispatch:
7+
inputs:
8+
dockerRepository:
9+
description: 'Docker repository'
10+
required: true
11+
default: 'preview'
12+
type: choice
13+
options:
14+
- preview
15+
- redash
716

817
env:
918
NODE_VERSION: 18
@@ -75,6 +84,7 @@ jobs:
7584
# TODO: We can use GitHub Actions's matrix option to reduce the build time.
7685
- name: Build and push preview image to Docker Hub
7786
uses: docker/build-push-action@v4
87+
if: ${{ github.event.inputs.dockerRepository == 'preview' || !github.event.workflow_run }}
7888
with:
7989
push: true
8090
tags: |
@@ -89,6 +99,22 @@ jobs:
8999
env:
90100
DOCKER_CONTENT_TRUST: true
91101

102+
- name: Build and push release image to Docker Hub
103+
uses: docker/build-push-action@v4
104+
if: ${{ github.event.inputs.dockerRepository == 'redash' }}
105+
with:
106+
push: true
107+
tags: |
108+
redash/redash:${{ steps.version.outputs.VERSION_TAG }}
109+
context: .
110+
build-args: |
111+
test_all_deps=true
112+
cache-from: type=gha,scope=multi-platform
113+
cache-to: type=gha,mode=max,scope=multi-platform
114+
platforms: linux/amd64,linux/arm64
115+
env:
116+
DOCKER_CONTENT_TRUST: true
117+
92118
- name: "Failure: output container logs to console"
93119
if: failure()
94120
run: docker compose logs

0 commit comments

Comments
 (0)