Add `workflow_dispatch` trigger for Docker builds
This commit is contained in:
parent
cf5ce177da
commit
5ded5310e7
|
@ -6,7 +6,12 @@ on: # yamllint disable-line rule:truthy
|
||||||
pull_request:
|
pull_request:
|
||||||
push:
|
push:
|
||||||
branches: ["release/*", "unstable/*"]
|
branches: ["release/*", "unstable/*"]
|
||||||
tags: ["*"]
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
tag:
|
||||||
|
description: Docker image tag
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
build-and-push:
|
||||||
|
@ -16,12 +21,14 @@ jobs:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Build Docker image
|
- name: Build Docker image
|
||||||
run: |
|
run: |
|
||||||
IMAGE="ghcr.io/$GITHUB_REPOSITORY:${GITHUB_REF_NAME/'/'/'-'}"
|
IMAGE="ghcr.io/$GITHUB_REPOSITORY:${DOCKER_TAG/'/'/'-'}"
|
||||||
echo "IMAGE=$IMAGE" >>"$GITHUB_ENV"
|
echo "IMAGE=$IMAGE" >>"$GITHUB_ENV"
|
||||||
docker build . \
|
docker build . \
|
||||||
--build-arg BUILDKIT_INLINE_CACHE=1 \
|
--build-arg BUILDKIT_INLINE_CACHE=1 \
|
||||||
--cache-from $IMAGE \
|
--cache-from $IMAGE \
|
||||||
--tag $IMAGE
|
--tag $IMAGE
|
||||||
|
env:
|
||||||
|
DOCKER_TAG: ${{ inputs.tag || github.ref_name }}
|
||||||
- name: Log in to GHCR
|
- name: Log in to GHCR
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
run: >-
|
run: >-
|
||||||
|
|
Loading…
Reference in New Issue