ci: Provide tag to docker steps in workflow

Tag field was available for workflow_dispatch, but the value wasn't
passed to relevant build steps.
pull/78/head
Robert Dailey 2 years ago
parent 27baeac08b
commit 9e9bba855d

@ -16,17 +16,18 @@ on:
workflow_dispatch: workflow_dispatch:
inputs: inputs:
release_tag: release_tag:
description: A release version of Recyclarr to build the image for. description: Release Tag
required: true required: true
type: string type: string
should_publish: should_publish:
description: If enabled, the image will get published to GHCR. description: Publish Image to GHCR?
required: false required: false
default: false default: false
type: boolean type: boolean
env: env:
SHOULD_PUBLISH: ${{ github.event_name == 'release' || github.event.inputs.should_publish == 'true' }} SHOULD_PUBLISH: ${{ github.event_name == 'release' || github.event.inputs.should_publish == 'true' }}
VERSION: ${{ github.event.release.tag_name || github.event.inputs.release_tag }}
jobs: jobs:
docker: docker:
@ -49,9 +50,9 @@ jobs:
with: with:
images: ghcr.io/${{ github.repository }} images: ghcr.io/${{ github.repository }}
tags: | tags: |
type=semver,pattern={{major}}.{{minor}}.{{patch}},value=${{ github.event.release.tag_name }} type=semver,pattern={{major}}.{{minor}}.{{patch}},value=${{ env.VERSION }}
type=semver,pattern={{major}}.{{minor}},value=${{ github.event.release.tag_name }} type=semver,pattern={{major}}.{{minor}},value=${{ env.VERSION }}
type=semver,pattern={{major}},value=${{ github.event.release.tag_name }} type=semver,pattern={{major}},value=${{ env.VERSION }}
- name: Login to GHCR - name: Login to GHCR
if: env.SHOULD_PUBLISH if: env.SHOULD_PUBLISH
@ -69,7 +70,7 @@ jobs:
no-cache: true no-cache: true
build-args: | build-args: |
REPOSITORY=${{ github.repository }} REPOSITORY=${{ github.repository }}
${{ github.event.release.tag_name && format('RELEASE_TAG={0}', github.event.release.tag_name) }} ${{ env.VERSION && format('RELEASE_TAG={0}', env.VERSION) }}
platforms: linux/arm/v7,linux/arm64,linux/amd64 platforms: linux/arm/v7,linux/arm64,linux/amd64
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}

Loading…
Cancel
Save