oizys/.github/workflows/build.yml

62 lines
1.3 KiB
YAML
Raw Normal View History

2024-05-23 13:27:08 -05:00
name: Build NixOS (on demand)
2024-01-23 16:09:05 -06:00
2024-01-23 11:51:13 -06:00
on:
2024-05-23 13:27:08 -05:00
workflow_dispatch:
inputs:
2024-06-20 11:17:27 -05:00
hosts:
2025-01-13 13:09:01 -06:00
description: "list of hosts to build"
2024-05-23 13:27:08 -05:00
required: true
type: string
2025-01-17 11:49:06 -06:00
default: "othalan,algiz"
2024-05-23 13:27:08 -05:00
lockFile:
2025-01-13 13:09:01 -06:00
description: "flake.lock file"
2024-05-23 13:27:08 -05:00
type: string
2025-01-17 11:49:06 -06:00
extraArgs:
description: "postional args forwared to nix"
type: string
default: "--keep-going"
2024-05-23 13:27:08 -05:00
workflow_call:
inputs:
2024-06-20 11:17:27 -05:00
hosts:
2025-01-13 13:09:01 -06:00
description: "list of hosts to build"
default: ",othalan,algiz"
2024-05-23 13:27:08 -05:00
type: string
2024-12-27 15:39:26 -06:00
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.host }}
cancel-in-progress: true
2024-01-23 11:51:13 -06:00
jobs:
build:
runs-on: ubuntu-latest
steps:
2024-06-14 12:17:39 -05:00
- name: Checkout
uses: actions/checkout@v4
2024-06-14 12:17:39 -05:00
2024-11-18 12:05:43 -06:00
- uses: ./.github/actions/nix
2024-11-18 12:10:46 -06:00
with:
attic_token: ${{ secrets.ATTIC_TOKEN }}
2024-11-19 14:35:29 -06:00
# clean: true
2024-11-18 12:47:05 -06:00
btrfs: true
2024-11-18 11:18:32 -06:00
2024-05-23 13:27:08 -05:00
- name: write lock file
if: "${{ inputs.lockFile != '' }}"
run: |
echo '${{ inputs.lockFile }}' > flake.lock
git diff
2024-08-07 13:07:38 -05:00
- name: Pre-build Oizys
2024-09-04 11:57:20 -05:00
run: nix build . --print-build-logs
2024-08-07 13:07:38 -05:00
2024-01-30 13:40:15 -06:00
- name: Build
2024-11-18 11:18:32 -06:00
run: >
nix run .
--
cache
2024-11-18 14:14:26 -06:00
--host,="${{ inputs.hosts }}"
2024-11-18 11:36:35 -06:00
--flake .
2025-01-07 15:48:32 -06:00
-vv
2024-11-18 11:18:32 -06:00
--
2025-01-17 11:49:06 -06:00
${{ inputs.extraArgs }}