oizys/.github/workflows/build.yml

61 lines
1.3 KiB
YAML

name: Build NixOS (on demand)
on:
workflow_dispatch:
inputs:
hosts:
description: "list of hosts to build"
required: true
type: string
default: "othalan,algiz"
lockFile:
description: "flake.lock file"
type: string
extraArgs:
description: "postional args forwared to nix"
type: string
default: "--keep-going"
workflow_call:
inputs:
hosts:
description: "list of hosts to build"
default: ",othalan,algiz"
type: string
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.host }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: ./.github/actions/nix
with:
attic_token: ${{ secrets.ATTIC_TOKEN }}
# clean: true
btrfs: true
- name: write lock file
if: "${{ inputs.lockFile != '' }}"
run: |
echo '${{ inputs.lockFile }}' > flake.lock
git diff
- name: Pre-build Oizys
run: nix build . --print-build-logs
- name: Build
run: >
nix run .
--
cache
--host,="${{ inputs.hosts }}"
--flake .
-vv
--
${{ inputs.extraArgs }}