Skip to content

Commit 5ded531

Browse files
committed
Add workflow_dispatch trigger for Docker builds
1 parent cf5ce17 commit 5ded531

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

.github/workflows/build-and-push-docker-image.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ on: # yamllint disable-line rule:truthy
66
pull_request:
77
push:
88
branches: ["release/*", "unstable/*"]
9-
tags: ["*"]
9+
workflow_dispatch:
10+
inputs:
11+
tag:
12+
description: Docker image tag
13+
required: true
14+
type: string
1015

1116
jobs:
1217
build-and-push:
@@ -16,12 +21,14 @@ jobs:
1621
- uses: actions/checkout@v4
1722
- name: Build Docker image
1823
run: |
19-
IMAGE="ghcr.io/$GITHUB_REPOSITORY:${GITHUB_REF_NAME/'/'/'-'}"
24+
IMAGE="ghcr.io/$GITHUB_REPOSITORY:${DOCKER_TAG/'/'/'-'}"
2025
echo "IMAGE=$IMAGE" >>"$GITHUB_ENV"
2126
docker build . \
2227
--build-arg BUILDKIT_INLINE_CACHE=1 \
2328
--cache-from $IMAGE \
2429
--tag $IMAGE
30+
env:
31+
DOCKER_TAG: ${{ inputs.tag || github.ref_name }}
2532
- name: Log in to GHCR
2633
if: github.event_name != 'pull_request'
2734
run: >-

0 commit comments

Comments
 (0)