Skip to content

Commit

Permalink
Allow manual input of tag.
Browse files Browse the repository at this point in the history
  • Loading branch information
dkocher committed Jan 14, 2025
1 parent 6c78a37 commit fb7d095
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions .github/workflows/duck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,38 @@ on:
push:
tags: ['*']
workflow_dispatch:
inputs:
tag:
description: 'Tag'
required: true
type: string

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build:
docker:
name: build
runs-on: ubuntu-latest
steps:
- name: Sanitize Version
- name: Determine Version from Input
if: ${{ github.event.inputs.tag }}
run: |
export TAG=${{ github.event.inputs.tag }}
echo "TAG=$TAG" >> "$GITHUB_ENV"
export VERSION=${TAG/release-}
export VERSION=${VERSION//-/.}
echo "VERSION=$VERSION" >> "$GITHUB_ENV"
- name: Determine Version
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: |
echo "TAG=${{ github.ref }}" >> "$GITHUB_ENV"
export VERSION=${GITHUB_REF#refs/tags/release-}
export VERSION=${VERSION//-/.}
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "VERSION=$VERSION" >> "$GITHUB_ENV"
- name: Print Version
run: echo "Building $VERSION"
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
Expand All @@ -35,6 +52,7 @@ jobs:
- name: checkout
uses: actions/checkout@v4
with:
ref: $TAG
fetch-depth: 0
- run: |
export COUNT=$(git rev-list --count $GITHUB_SHA)
Expand Down

0 comments on commit fb7d095

Please sign in to comment.