feat(workflow): add manual trigger and tag input for Docker image builds
- Introduce a `workflow_dispatch` event to allow manual triggering of the Docker image build workflow. - Add an input parameter for specifying the tag name, enhancing flexibility in build processes. - Update tag resolution logic to prioritize the input tag when provided, ensuring accurate versioning during builds.
This commit is contained in:
parent
0b799d4716
commit
46305ebcaa
21
.github/workflows/docker-image-arm64.yml
vendored
21
.github/workflows/docker-image-arm64.yml
vendored
@ -4,6 +4,12 @@ on:
|
|||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- '*'
|
- '*'
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
tag:
|
||||||
|
description: 'Tag name to build (e.g., v0.10.8-alpha.3)'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build_single_arch:
|
build_single_arch:
|
||||||
@ -33,7 +39,11 @@ jobs:
|
|||||||
- name: Resolve tag & write VERSION
|
- name: Resolve tag & write VERSION
|
||||||
run: |
|
run: |
|
||||||
git fetch --tags --force --depth=1
|
git fetch --tags --force --depth=1
|
||||||
TAG=${GITHUB_REF#refs/tags/}
|
if [ -n "${{ github.event.inputs.tag }}" ]; then
|
||||||
|
TAG="${{ github.event.inputs.tag }}"
|
||||||
|
else
|
||||||
|
TAG=${GITHUB_REF#refs/tags/}
|
||||||
|
fi
|
||||||
echo "TAG=$TAG" >> $GITHUB_ENV
|
echo "TAG=$TAG" >> $GITHUB_ENV
|
||||||
echo "$TAG" > VERSION
|
echo "$TAG" > VERSION
|
||||||
echo "Building tag: $TAG for ${{ matrix.arch }}"
|
echo "Building tag: $TAG for ${{ matrix.arch }}"
|
||||||
@ -87,10 +97,15 @@ jobs:
|
|||||||
name: Create multi-arch manifests (Docker Hub)
|
name: Create multi-arch manifests (Docker Hub)
|
||||||
needs: [build_single_arch]
|
needs: [build_single_arch]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
|
||||||
steps:
|
steps:
|
||||||
- name: Extract tag
|
- name: Extract tag
|
||||||
run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
|
run: |
|
||||||
|
if [ -n "${{ github.event.inputs.tag }}" ]; then
|
||||||
|
echo "TAG=${{ github.event.inputs.tag }}" >> $GITHUB_ENV
|
||||||
|
else
|
||||||
|
echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
#
|
#
|
||||||
# - name: Normalize GHCR repository
|
# - name: Normalize GHCR repository
|
||||||
# run: echo "GHCR_REPOSITORY=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
|
# run: echo "GHCR_REPOSITORY=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user