mirror of
https://github.com/daylinmorgan/oizys.git
synced 2024-11-05 06:03:15 -06:00
52 lines
1.2 KiB
YAML
52 lines
1.2 KiB
YAML
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'
|
|
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
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
# free up some space
|
|
- run: sudo rm -rf /opt&
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: DeterminateSystems/nix-installer-action@main
|
|
- uses: DeterminateSystems/magic-nix-cache-action@v2
|
|
|
|
- uses: cachix/cachix-action@v14
|
|
with:
|
|
name: daylin
|
|
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
|
|
|
- name: write lock file
|
|
if: "${{ inputs.lockFile != '' }}"
|
|
run: |
|
|
echo '${{ inputs.lockFile }}' > flake.lock
|
|
git diff
|
|
|
|
- name: Build
|
|
run: |
|
|
nix run . --accept-flake-config -- cache --host "${{ inputs.host }}" --flake .
|