From 7c0579629f8226dd7a9e1fa5755db38a3e108fcf Mon Sep 17 00:00:00 2001 From: Robert Dailey Date: Mon, 30 May 2022 16:12:15 -0500 Subject: [PATCH] ci: Allow manual execution of Docker workflow --- .github/workflows/docker.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 87ec750b..e03be254 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -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 }}