mirror of
https://github.com/daylinmorgan/oizys.git
synced 2024-12-22 14:20:44 -06:00
add on-demand builder
This commit is contained in:
parent
fdc7fe80d5
commit
55b0e588e1
1 changed files with 42 additions and 0 deletions
42
.github/workflows/on-demand.yml
vendored
Normal file
42
.github/workflows/on-demand.yml
vendored
Normal file
|
@ -0,0 +1,42 @@
|
|||
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'
|
||||
required: true
|
||||
type: string
|
||||
|
||||
# TODO: add concurrency check to cancel in-progress builds
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# free up some space
|
||||
- run: sudo rm -rf /opt&
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install Nix
|
||||
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
|
||||
run: |
|
||||
echo '${{ inputs.lockFile }}' > flake.lock
|
||||
git diff
|
||||
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
nix run . --accept-flake-config -- cache --host "${{ inputs.host }}" --flake .
|
Loading…
Reference in a new issue