ci: repair build pipeline for the zo forge fork
The workflows were still the upstream GitHub ones and never ran here:
Deploy triggered on `main` (this fork's branch is `dev`), pushed to
`ghcr.io/jnsgruk/brewlog` (unreachable from this forge), and deployed to
jnsgruk's Fly.io.
- Deploy → build on push to `dev`, publish to this forge's own registry
(git.ziemlichoptimal.de/uberbau/brewlog:{sha,dev}) via the auto GITHUB_TOKEN.
- Drop the Fly.io deploy step and the dead version-extract step; the moby
homelab deploys the image via Flux GitOps, not from this pipeline.
- Retarget PR CI (push.yml) from `main` to `dev`.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
8c5697ccc2
commit
97b1d580e3
2 changed files with 25 additions and 22 deletions
45
.github/workflows/deploy.yml
vendored
45
.github/workflows/deploy.yml
vendored
|
|
@ -1,12 +1,23 @@
|
||||||
name: Deploy
|
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:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: ["main"]
|
branches: ["dev"]
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
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:
|
jobs:
|
||||||
check:
|
check:
|
||||||
name: Check
|
name: Check
|
||||||
|
|
@ -46,44 +57,36 @@ jobs:
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: cargo test -- --show-output
|
run: cargo test -- --show-output
|
||||||
|
|
||||||
deploy:
|
build:
|
||||||
name: Deploy
|
name: Build & Publish
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [check]
|
needs: [check]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Install mise
|
|
||||||
uses: jdx/mise-action@v4
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v4
|
uses: docker/setup-buildx-action@v4
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
- name: Login to the forge container registry
|
||||||
uses: docker/login-action@v4
|
uses: docker/login-action@v4
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
# 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 }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Extract version from Cargo.toml
|
|
||||||
id: version
|
|
||||||
run: echo "version=$(grep '^version = ' Cargo.toml | head -1 | cut -d'"' -f2)" >> "$GITHUB_OUTPUT"
|
|
||||||
|
|
||||||
- name: Build and push container
|
- name: Build and push container
|
||||||
uses: docker/build-push-action@v7
|
uses: docker/build-push-action@v7
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
push: true
|
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: |
|
tags: |
|
||||||
ghcr.io/jnsgruk/brewlog:${{ github.sha }}
|
${{ env.IMAGE }}:${{ github.sha }}
|
||||||
ghcr.io/jnsgruk/brewlog:latest
|
${{ env.IMAGE }}:dev
|
||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max
|
||||||
|
|
||||||
- name: Deploy to Fly.io
|
|
||||||
run: |
|
|
||||||
flyctl deploy -i "ghcr.io/jnsgruk/brewlog:${{ github.sha }}"
|
|
||||||
env:
|
|
||||||
FLY_ACCESS_TOKEN: ${{ secrets.FLY_API_TOKEN }}
|
|
||||||
|
|
|
||||||
2
.github/workflows/push.yml
vendored
2
.github/workflows/push.yml
vendored
|
|
@ -1,7 +1,7 @@
|
||||||
name: CI
|
name: CI
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: ["main"]
|
branches: ["dev"]
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue