oizys/.github/workflows/on-demand.yml

53 lines
1.2 KiB
YAML
Raw Normal View History

2024-05-22 14:42:20 -05:00
name: Build NixOS (on demand)
on:
workflow_dispatch:
inputs:
host:
description: 'host name to build'
required: true
default: 'othalan'
type: string
lockFile:
description: 'flake.lock file'
2024-05-23 13:13:04 -05:00
type: string
workflow_call:
inputs:
host:
description: 'host name to build'
2024-05-22 14:42:20 -05:00
required: true
2024-05-23 13:13:04 -05:00
default: 'othalan'
2024-05-22 14:42:20 -05:00
type: string
2024-05-23 13:13:04 -05:00
2024-05-22 15:06:19 -05:00
concurrency:
2024-05-23 13:13:04 -05:00
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.host }}
2024-05-22 15:06:19 -05:00
cancel-in-progress: true
2024-05-22 14:42:20 -05:00
jobs:
build:
runs-on: ubuntu-latest
steps:
# free up some space
- run: sudo rm -rf /opt&
- uses: actions/checkout@v4
2024-05-23 13:13:04 -05:00
- uses: DeterminateSystems/nix-installer-action@main
2024-05-22 14:42:20 -05:00
- uses: DeterminateSystems/magic-nix-cache-action@v2
- uses: cachix/cachix-action@v14
with:
name: daylin
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: write lock file
2024-05-23 13:13:04 -05:00
if: "${{ inputs.lockFile != '' }}"
2024-05-22 14:42:20 -05:00
run: |
echo '${{ inputs.lockFile }}' > flake.lock
git diff
- name: Build
run: |
nix run . --accept-flake-config -- cache --host "${{ inputs.host }}" --flake .