Skip to content

Commit 3921a0c

Browse files
committed
refactor: extract inputs
Signed-off-by: Yukai Huang <[email protected]>
1 parent c4f04e4 commit 3921a0c

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

Diff for: .github/actions/build-steps/action.yml

+14-5
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,22 @@ on:
66
platform:
77
required: true
88
type: string
9+
registry_image:
10+
required: true
11+
type: string
12+
runtime:
13+
required: true
14+
type: string
15+
buildpack:
16+
required: true
17+
type: string
918

1019
jobs:
1120
build:
1221
runs-on: ${{ inputs.platform == 'linux/arm64' && 'macos-latest' || 'ubuntu-latest' }}
1322
steps:
1423
-
15-
name: Prepare
24+
name: Prepare Platform Environment
1625
run: |
1726
echo "PLATFORM_PAIR=${{ inputs.platform//\//- }}" >> $GITHUB_ENV
1827
-
@@ -23,7 +32,7 @@ jobs:
2332
id: meta
2433
uses: docker/metadata-action@v5
2534
with:
26-
images: ${{ env.REGISTRY_IMAGE }}
35+
images: ${{ inputs.registry_image }}
2736
-
2837
name: Set up QEMU
2938
uses: docker/setup-qemu-action@v3
@@ -45,10 +54,10 @@ jobs:
4554
file: ./deployments/Dockerfile
4655
platforms: ${{ inputs.platform }}
4756
labels: ${{ steps.meta.outputs.labels }}
48-
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
57+
outputs: type=image,name=${{ inputs.registry_image }},push-by-digest=true,name-canonical=true,push=true
4958
build-args: |
50-
RUNTIME=${{ github.event.inputs.runtime || 'hackmdio/runtime:16.20.2-35fe7e39' }}
51-
BUILDPACK=${{ github.event.inputs.buildpack || 'hackmdio/buildpack:16.20.2-35fe7e39' }}
59+
RUNTIME=${{ inputs.runtime }}
60+
BUILDPACK=${{ inputs.buildpack }}
5261
-
5362
name: Export digest
5463
run: |

Diff for: .github/workflows/push-image.yml

+6
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ jobs:
3030
uses: ./.github/actions/build-steps
3131
with:
3232
platform: linux/amd64
33+
registry_image: ${{ env.REGISTRY_IMAGE }}
34+
runtime: ${{ github.event.inputs.runtime }}
35+
buildpack: ${{ github.event.inputs.buildpack }}
3336

3437
build-arm64:
3538
runs-on: macos-latest
@@ -43,6 +46,9 @@ jobs:
4346
uses: ./.github/actions/build-steps
4447
with:
4548
platform: linux/arm64
49+
registry_image: ${{ env.REGISTRY_IMAGE }}
50+
runtime: ${{ github.event.inputs.runtime }}
51+
buildpack: ${{ github.event.inputs.buildpack }}
4652

4753
merge:
4854
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)