brewlog/.github/workflows/deploy.yml
Niels Göttsch d904689b38
Some checks failed
Build & Publish / Check (push) Failing after 3m28s
Build & Publish / Build & Publish (push) Has been skipped
ci: pin actions to the node20 generation for the forge runner
The forge's forgejo-runner (v6.3.1) only supports node runtimes up to node20,
but resolves bare `uses:` from code.forgejo.org where checkout@v6 (and the
other @v5/v6/v7 actions) declare `runs.using: node24` -> "must be one of
[... node20 ...], got node24" -> job failed before any step ran.

- checkout@v6->v4, cache@v5->v4, docker/{setup-buildx@v4->v3, login@v4->v3,
  build-push@v7->v6}: all node20.
- jdx/mise-action isn't mirrored on code.forgejo.org; reference it by full
  github URL, pinned to @v2 (node20).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-16 15:55:22 +02:00

92 lines
2.9 KiB
YAML

name: Build & Publish
# Fork build pipeline for the "zo" forge (git.ziemlichoptimal.de/uberbau/brewlog).
# On every push to `dev` this checks the code, then builds the container and
# publishes it to this forge's own container registry. The moby homelab
# (git.ziemlichoptimal.de/moby/cluster-moby) deploys the resulting image via
# Flux GitOps — this pipeline does NOT deploy anything itself (the upstream
# Fly.io deploy step was removed).
on:
push:
branches: ["dev"]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
# This forge's built-in container registry, same host as the git server.
REGISTRY: git.ziemlichoptimal.de
IMAGE: git.ziemlichoptimal.de/uberbau/brewlog
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install mise
uses: https://github.com/jdx/mise-action@v2
- name: Cache Cargo artifacts
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}-check
restore-keys: |
cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}-
cargo-${{ runner.os }}-
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y clang lld mold libssl-dev pkg-config
- name: Ensure Rust components
run: rustup component add rustfmt clippy
- name: Check formatting
run: cargo fmt -- --check
- name: Clippy
run: cargo clippy -- -D warnings
- name: Run tests
run: cargo test -- --show-output
build:
name: Build & Publish
runs-on: ubuntu-latest
needs: [check]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to the forge container registry
uses: docker/login-action@v3
with:
# Forgejo auto-provides GITHUB_TOKEN to the job; it can push packages
# for this repo's owner (uberbau). No external registry / PAT needed.
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push container
uses: docker/build-push-action@v6
with:
context: .
push: true
# `dev` is the moving branch tag; the commit SHA is the immutable
# reference. The moby Deployment pins the image by digest, so bump it
# there per release (a floating tag never re-rolls the pod on its own).
tags: |
${{ env.IMAGE }}:${{ github.sha }}
${{ env.IMAGE }}:dev
cache-from: type=gha
cache-to: type=gha,mode=max