depot/.forgejo/workflows/ci.yaml

61 lines
1.7 KiB
YAML

on: [push]
jobs:
generate-targets:
runs-on: cacher
outputs:
targets: ${{ steps.build.outputs.targets }}
machines: ${{ steps.build.outputs.machines }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Drop in ops/secrets/default.nix
run:
echo "$OPS_SECRETS_DEFAULTNIX" > ops/secrets/default.nix
env:
OPS_SECRETS_DEFAULTNIX: "${{ secrets.OPS_SECRETS_DEFAULTNIX }}"
- id: build
name: Build matrix
run: |
cat "$(nix-build ci-root.nix -A forgejoMatrix)" >> "$GITHUB_OUTPUT"
build:
runs-on: cacher
needs: [generate-targets]
strategy:
matrix:
target: ${{ fromJSON(needs.generate-targets.outputs.targets) }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Drop in ops/secrets/default.nix
run: |
echo "$OPS_SECRETS_DEFAULTNIX" > ops/secrets/default.nix
env:
OPS_SECRETS_DEFAULTNIX: "${{ secrets.OPS_SECRETS_DEFAULTNIX }}"
- name: Build
run: |
nix-build ci-root.nix -A "${{ matrix.target }}"
build-machine:
runs-on: cacher
needs: [generate-targets]
strategy:
matrix:
target: ${{ fromJSON(needs.generate-targets.outputs.machines) }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Drop in ops/secrets/default.nix
run: |
echo "$OPS_SECRETS_DEFAULTNIX" > ops/secrets/default.nix
env:
OPS_SECRETS_DEFAULTNIX: "${{ secrets.OPS_SECRETS_DEFAULTNIX }}"
- name: Build
run: |
nix-build ci-root.nix -A "machine.${{ matrix.target }}"