Compare commits

...

2 commits

Author SHA1 Message Date
f1813b4a47
abstract 2024-05-23 13:47:12 -05:00
85ed8b7f78
update on-demand definition 2024-05-23 13:13:04 -05:00
4 changed files with 58 additions and 60 deletions

View file

@ -1,27 +1,39 @@
name: Build NixOS
name: Build NixOS (on demand)
on:
push:
branches:
- main
pull_request:
branches:
- main
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
strategy:
max-parallel: 1
matrix:
host: ["othalan", "mannaz", "algiz"]
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/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@v2
- uses: cachix/cachix-action@v14
@ -29,6 +41,12 @@ jobs:
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 "${{ matrix.host }}" --flake .
nix run . --accept-flake-config -- cache --host "${{ inputs.host }}" --flake .

View file

@ -1,45 +0,0 @@
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
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
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 .

23
.github/workflows/push.yml vendored Normal file
View file

@ -0,0 +1,23 @@
name: Build NixOS
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
strategy:
max-parallel: 1
matrix:
host:
- othalan
# - mannaz
# - algiz
uses: ./.github/workflows/build.yml
with:
host: "${{ matrix.host }}"
secrets: inherit

View file

@ -12,4 +12,6 @@
- [ ] find out why pixi on GHA is different from local (possibly from the fetch git step?)
- [ ] rework CI so it's not building all systems on every pull
<!-- generated with <3 by daylinmorgan/todo -->