nixos-configuration/.forgejo/workflows/build.yaml
müde cb4acd6665
Some checks failed
build / build (muede-lpt2) (push) Has been cancelled
build / build (muede-pc2) (push) Has been cancelled
build / close-on-failure (push) Has been cancelled
add ci
2026-09-13 14:36:08 +02:00

36 lines
1.2 KiB
YAML

name: build
on:
pull_request: {}
push:
branches: [ main ]
jobs:
build:
runs-on: nixos
strategy:
matrix:
# keep-sorted start
host: [muede-lpt2, muede-pc2]
# keep-sorted end
steps:
- uses: https://code.forgejo.org/actions/checkout@v4
- run: nix build --no-link .#nixosConfigurations.${{ matrix.host }}.config.system.build.toplevel
# nightly-flake-update.yaml opens PRs from flake-update-* branches; if
# the build fails on one of those, close it rather than leaving a
# broken auto-generated PR around. Scoped to that branch prefix so a
# failing build on a human-authored PR is never auto-closed.
close-on-failure:
needs: build
if: failure() && startsWith(github.head_ref, 'flake-update-')
runs-on: nixos
steps:
- run: |
curl -sf -X PATCH \
-H "Authorization: token ${PR_BOT_TOKEN}" \
-H "Content-Type: application/json" \
-d '{"state": "closed"}' \
"https://forge.darkest.space/api/v1/repos/mara/nixos-configs/pulls/${{ github.event.pull_request.number }}"
env:
PR_BOT_TOKEN: ${{ secrets.PR_BOT_TOKEN }}