Skip to content

Workflow file for this run

name: Build and test flake outputs
on:
push:
workflow_dispatch:
workflow_call:
inputs:
branch:
description: Branch name to build on
default: ""
required: false
type: string
secrets:
CACHIX_ACTIVATE_TOKEN:
CACHIX_AUTH_TOKEN:
required: true
jobs:
nix:
strategy:
fail-fast: false
matrix:
system:
- aarch64
nix-command:
- fmt -- --check
- eval .#apps.$_system.nixos-shell.program
- eval .#apps.$_system.setup.program
runs-on: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- name: Install nix
uses: cachix/install-nix-action@v25
with:
extra_nix_config: |
keep-going = true
- name: Setup cachix
uses: cachix/cachix-action@v14
with:
name: gerschtli
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Build command
env:
_system: ${{ matrix.system }}-linux
run: nix ${{ matrix.nix-command }}
- name: Deploy cachix-agent spec
if: github.ref == 'refs/heads/master' && inputs.branch == '' && matrix.deploy-agent
env:
CACHIX_ACTIVATE_TOKEN: ${{ secrets.CACHIX_ACTIVATE_TOKEN }}
run: |
echo "::group::Build spec"
spec="$(nix build --print-out-paths ".#cachix-deploy-spec-${{ matrix.deploy-agent }}")"
echo "::group::Upload spec"
cachix push gerschtli "$spec"
echo "::group::Activate deployment"
cachix deploy activate --agent "${{ matrix.deploy-agent }}" ${{ matrix.deploy-args }} "$spec"
# vim: set sw=2: