Skip to content

Commit

Permalink
refactor: move registry_image to inputs
Browse files Browse the repository at this point in the history
Signed-off-by: Yukai Huang <yukaihuangtw@gmail.com>
  • Loading branch information
Yukaii committed Oct 30, 2024
1 parent 215f022 commit e9f97a7
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/push-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ on:
description: 'Buildpack image'
required: true
default: 'hackmdio/buildpack:16.20.2-35fe7e39'

env:
REGISTRY_IMAGE: hackmdio/hackmd
registry_image:
description: 'image name'
required: false
default: 'hackmdio/hackmd'

jobs:
build-amd64:
Expand All @@ -24,7 +25,7 @@ jobs:
with:
platform: linux/amd64
platform_pair: linux_amd64
registry_image: ${{ env.REGISTRY_IMAGE }}
registry_image: ${{ github.event.inputs.registry_image }}
runtime: ${{ github.event.inputs.runtime }}
buildpack: ${{ github.event.inputs.buildpack }}
runs_on: ubuntu-latest
Expand All @@ -35,7 +36,7 @@ jobs:
with:
platform: linux/arm64
platform_pair: linux_arm64
registry_image: ${{ env.REGISTRY_IMAGE }}
registry_image: ${{ github.event.inputs.registry_image }}
runtime: ${{ github.event.inputs.runtime }}
buildpack: ${{ github.event.inputs.buildpack }}
runs_on: macos-latest
Expand All @@ -61,7 +62,7 @@ jobs:
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_IMAGE }}
images: ${{ github.event.inputs.registry_image }}
tags: |
type=match,pattern=\d.\d.\d
type=sha,prefix=
Expand All @@ -76,8 +77,8 @@ jobs:
working-directory: /tmp/digests
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
$(printf '${{ github.event.inputs.registry_image }}@sha256:%s ' *)
-
name: Inspect image
run: |
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
docker buildx imagetools inspect ${{ github.event.inputs.registry_image }}:${{ steps.meta.outputs.version }}

0 comments on commit e9f97a7

Please sign in to comment.