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:
|
|
|
|
host:
|
|
|
|
description: 'host name to build'
|
|
|
|
required: true
|
|
|
|
default: 'othalan'
|
|
|
|
type: string
|
|
|
|
lockFile:
|
|
|
|
description: 'flake.lock file'
|
|
|
|
type: string
|
|
|
|
|
|
|
|
workflow_call:
|
|
|
|
inputs:
|
|
|
|
host:
|
|
|
|
description: 'host name to build'
|
|
|
|
required: true
|
|
|
|
default: 'othalan'
|
|
|
|
type: string
|
|
|
|
|
|
|
|
|
|
|
|
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-01-23 14:51:12 -06:00
|
|
|
# free up some space
|
2024-01-23 13:10:13 -06:00
|
|
|
- run: sudo rm -rf /opt&
|
2024-01-23 11:51:13 -06:00
|
|
|
- uses: actions/checkout@v4
|
2024-05-23 13:27:08 -05:00
|
|
|
|
|
|
|
- uses: DeterminateSystems/nix-installer-action@main
|
2024-01-23 11:51:13 -06:00
|
|
|
- uses: DeterminateSystems/magic-nix-cache-action@v2
|
2024-02-19 14:16:00 -06:00
|
|
|
|
2024-01-23 11:51:13 -06:00
|
|
|
- uses: cachix/cachix-action@v14
|
|
|
|
with:
|
|
|
|
name: daylin
|
|
|
|
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
2024-02-19 14:16:00 -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-01-30 13:40:15 -06:00
|
|
|
- name: Build
|
|
|
|
run: |
|
2024-05-23 13:27:08 -05:00
|
|
|
nix run . --accept-flake-config -- cache --host "${{ inputs.host }}" --flake .
|