Files
minstrel/.forgejo/workflows/release.yml
T
bvandeusen d8bfdc1733 chore(ci): .dockerignore + path filters on existing workflows
The repo now contains the Flutter mobile client at flutter_client/
(M7 #356). Two cleanups so the existing build pipelines don't churn
on Flutter-only changes:

1. .dockerignore — keep the Flutter project (and docs/, IDE noise,
   git metadata) out of the Docker build context. The runtime image
   was already unaffected (multi-stage drops everything but the Go
   binary), but the COPY . . layer cache invalidated on every
   Flutter edit. Build context shrinks ~2.4 MB and Flutter-only
   pushes no longer force Go rebuilds.
2. test.yml + release.yml — paths-ignore on flutter_client/**,
   docs/**, and **/*.md. Go/web tests + container build now skip
   when the diff doesn't touch them. Tag releases still build broadly
   since server + Flutter ship paired.

The Flutter-side workflow lands in M7 Task 21 with its own paths
filter restricting it to flutter_client/** and the shared web/
inputs (tokens.json, error-copy.json, album-fallback.svg).
2026-05-02 16:05:28 -04:00

69 lines
2.1 KiB
YAML

name: release
# Builds and pushes the minstrel container image to the Forgejo registry.
#
# push to main → :main
# push tag vX.Y.Z → :vX.Y.Z and :latest
# workflow_dispatch → manual trigger (same rules based on the ref)
on:
push:
branches: [main]
tags: ['v*']
# Tag pushes still build (tag releases are intentional, server + Flutter
# share the version). Branch pushes skip when the diff is Flutter-only —
# rebuilding the Go image for a Flutter-only merge wastes CI and churns
# the registry.
paths-ignore:
- 'flutter_client/**'
- 'docs/**'
- '**/*.md'
workflow_dispatch:
jobs:
release:
runs-on: go-ci
env:
IMAGE: git.fabledsword.com/bvandeusen/minstrel
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Detect buildable project
id: guard
shell: bash
run: |
if [ -f Dockerfile ] && [ -f go.mod ]; then
echo "ready=true" >> "$GITHUB_OUTPUT"
else
echo "ready=false" >> "$GITHUB_OUTPUT"
echo "::notice::No Dockerfile + go.mod yet — release build skipped"
fi
- name: Compute image tags
id: tags
if: steps.guard.outputs.ready == 'true'
shell: bash
run: |
if [[ "${GITHUB_REF}" == refs/tags/v* ]]; then
VERSION="${GITHUB_REF#refs/tags/}"
echo "args=-t ${IMAGE}:${VERSION} -t ${IMAGE}:latest" >> "$GITHUB_OUTPUT"
echo "::notice::Release build: ${VERSION} + latest"
else
echo "args=-t ${IMAGE}:main" >> "$GITHUB_OUTPUT"
echo "::notice::Main-branch build: :main"
fi
- name: Registry login
if: steps.guard.outputs.ready == 'true'
shell: bash
run: |
echo "${{ secrets.REGISTRY_TOKEN }}" \
| docker login git.fabledsword.com -u "${{ github.actor }}" --password-stdin
- name: Build and push
if: steps.guard.outputs.ready == 'true'
run: docker buildx build --push ${{ steps.tags.outputs.args }} .