oizys/.github/workflows/build.yml
2024-06-29 18:39:52 -05:00

75 lines
2 KiB
YAML

name: Build NixOS (on demand)
on:
workflow_dispatch:
inputs:
hosts:
description: 'list of hosts to build'
required: true
default: 'othalan algiz'
type: string
lockFile:
description: 'flake.lock file'
type: string
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/clean-disk
- uses: DeterminateSystems/nix-installer-action@v12
with:
extra-conf: |
accept-flake-config = true
- uses: DeterminateSystems/magic-nix-cache-action@v7
- uses: cachix/cachix-action@v15
with:
name: daylin
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: Swap Lix for nix
run: |
which nix
sudo nix run \
--experimental-features "nix-command flakes" \
--extra-substituters https://cache.lix.systems --extra-trusted-public-keys "cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o=" \
'git+https://git@git.lix.systems/lix-project/lix?ref=refs/tags/2.90.0-rc1' -- \
upgrade-nix \
--extra-substituters https://cache.lix.systems --extra-trusted-public-keys "cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o="
- name: write lock file
if: "${{ inputs.lockFile != '' }}"
run: |
echo '${{ inputs.lockFile }}' > flake.lock
git diff
- name: Build
run: |
for host in ${{ inputs.hosts }}; do
nix run . \
-- \
build --minimal \
--host "$host" \
--flake . \
--verbose \
-- \
--print-build-logs
done