chore(ci): compute frontend metadata via script
This commit is contained in:
parent
a8f7b00efa
commit
58fbf7e8bd
@ -52,17 +52,7 @@ jobs:
|
||||
steps:
|
||||
- name: Compute image metadata
|
||||
id: meta
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
image_tag="${{ github.event.inputs.image_tag }}"
|
||||
if [[ -z "${image_tag}" ]]; then
|
||||
image_tag="${GITHUB_SHA}"
|
||||
fi
|
||||
ghcr_namespace="${GITHUB_REPOSITORY_OWNER,,}"
|
||||
echo "ghcr_namespace=${ghcr_namespace}" >> "${GITHUB_OUTPUT}"
|
||||
echo "image_tag=${image_tag}" >> "${GITHUB_OUTPUT}"
|
||||
echo "image_ref=ghcr.io/${ghcr_namespace}/dashboard:${image_tag}" >> "${GITHUB_OUTPUT}"
|
||||
run: bash scripts/github-actions/compute-frontend-release-metadata.sh "${{ github.event.inputs.image_tag }}"
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
21
scripts/github-actions/compute-frontend-release-metadata.sh
Executable file
21
scripts/github-actions/compute-frontend-release-metadata.sh
Executable file
@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
IMAGE_TAG_INPUT="${1-}"
|
||||
IMAGE_TAG="${IMAGE_TAG_INPUT}"
|
||||
if [[ -z "${IMAGE_TAG}" ]]; then
|
||||
IMAGE_TAG="${GITHUB_SHA}"
|
||||
fi
|
||||
|
||||
GHCR_NAMESPACE="${GITHUB_REPOSITORY_OWNER,,}"
|
||||
|
||||
if [[ -z "${GITHUB_OUTPUT-}" ]]; then
|
||||
echo "GITHUB_OUTPUT is not set" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
{
|
||||
printf 'ghcr_namespace=%s\n' "${GHCR_NAMESPACE}"
|
||||
printf 'image_tag=%s\n' "${IMAGE_TAG}"
|
||||
printf 'image_ref=ghcr.io/%s/dashboard:%s\n' "${GHCR_NAMESPACE}" "${IMAGE_TAG}"
|
||||
} >> "${GITHUB_OUTPUT}"
|
||||
Loading…
Reference in New Issue
Block a user