ci: Allow manual execution of Docker workflow

pull/76/head
Robert Dailey 2 years ago
parent 143bb634f0
commit 7c0579629f

@ -13,6 +13,21 @@ on:
release:
types: [ published ]
workflow_dispatch:
inputs:
release_tag:
description: A release version of Recyclarr to build the image for.
required: true
type: string
should_publish:
description: If enabled, the image will get published to GHCR.
required: false
default: false
type: boolean
env:
SHOULD_PUBLISH: ${{ github.event_name == 'release' || github.event.inputs.should_publish == 'true' }}
jobs:
docker:
name: Build & Push Docker Image
@ -39,7 +54,7 @@ jobs:
type=semver,pattern={{major}},value=${{ github.event.release.tag_name }}
- name: Login to GHCR
if: github.event_name == 'release'
if: env.SHOULD_PUBLISH
uses: docker/login-action@v1
with:
registry: ghcr.io
@ -50,7 +65,7 @@ jobs:
uses: docker/build-push-action@v2
with:
context: ./docker
push: ${{ github.event_name == 'release' }}
push: ${{ env.SHOULD_PUBLISH }}
no-cache: true
build-args: |
REPOSITORY=${{ github.repository }}

Loading…
Cancel
Save