This commit is contained in:
Daylin Morgan 2024-05-23 13:27:08 -05:00
parent 85ed8b7f78
commit f1813b4a47
Signed by: daylin
GPG Key ID: 950D13E9719334AD
3 changed files with 56 additions and 70 deletions

View File

@ -1,30 +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
@ -32,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,52 +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'
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 .

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