Skip to content

ci(publish): enables workflow_dispatch event trigger #18

ci(publish): enables workflow_dispatch event trigger

ci(publish): enables workflow_dispatch event trigger #18

Workflow file for this run

name: Publish
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
tag:
description: 'Git tag to release'
required: true
type: string
jobs:
publish:
name: "Publish to DockerHub"
runs-on: ubuntu-latest
env:
VERSION: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag || github.ref_name }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: "${{ env.VERSION }}"
- uses: docker/metadata-action@v5
id: meta
with:
images: ${{ github.repository }}
tags: |
type=schedule
type=semver,pattern={{version}},value=${{ env.VERSION }},match=v(\d.\d.\d)
type=semver,pattern={{major}}.{{minor}},value=${{ env.VERSION }},match=v(\d.\d)
type=semver,pattern={{major}},value=${{ env.VERSION }},match=v(\d)
type=sha
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
username: "${{ secrets.DOCKER_USERNAME }}"
password: "${{ secrets.DOCKER_TOKEN }}"
- uses: docker/build-push-action@v6
with:
push: true
build-args: |
VERSION=${{ env.VERSION }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}