Skip to content

Build and Publish (refs/heads/main) #9

Build and Publish (refs/heads/main)

Build and Publish (refs/heads/main) #9

Workflow file for this run

name: Build and Publish
run-name: Build and Publish (${{ github.ref }}) ${{ inputs.dry_run && '(🧪 Dry-Run)' || '' }}
on:
push:
tags:
- v*
release:
types: [published, released]
workflow_dispatch:
inputs:
dry_run:
description: "Dry run"
type: boolean
default: true
build_items:
description: "Build items"
type: string
default: "binary,docker"
permissions:
contents: write
packages: write
id-token: write
jobs:
# Get the current tag
get_tag:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.get_tag.outputs.tag }}
steps:
- name: Get tag
id: get_tag
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
# Build the Docker image
docker:
needs: get_tag
if: inputs.build_items == '' || contains(inputs.build_items, 'docker')
uses: ./.github/workflows/build-docker.yml
with:
version: ${{ needs.get_tag.outputs.tag }}
dry_run: ${{ inputs.dry_run || false }}
secrets: inherit
# Build the binary app
binary:
needs: get_tag
if: inputs.build_items == '' || contains(inputs.build_items, 'binary')
uses: ./.github/workflows/build-binary.yml
with:
version: ${{ needs.get_tag.outputs.tag }}
dry_run: ${{ inputs.dry_run || false }}
secrets: inherit