Skip to content

Use GITHUB_OUTPUT

Use GITHUB_OUTPUT #189

Workflow file for this run

name: Build
on:
push:
branches:
- main
- ci
jobs:
build:
runs-on: ubuntu-24.04
steps:
- uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-24.05
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: cachix/cachix-action@v15
with:
name: packer-kubernetes-hcloud
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- uses: actions/checkout@v4
- run: nix build '.#nixosConfigurations.hcloud-kubernetes.config.system.build.toplevel'
prepare-arm64-runner:
#if: false
runs-on: ubuntu-24.04
outputs:
cache-status: ${{ steps.cache-status.outputs.cache-status }}
steps:
- uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-24.05
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: cachix/cachix-action@v15
with:
name: packer-kubernetes-hcloud
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- uses: actions/checkout@v4
- run: nix-env -i jq nix-eval-jobs -f '<nixpkgs>'
- run: nix-eval-jobs --gc-roots-dir gcroot --check-cache-status --flake '.#nixosConfigurations.install-image-orangepi5plus.config.system.build.toplevel' | tee result.json
- id: cache-status
run: echo "cache-status=$(jq -r .cacheStatus result.json)" >> $GITHUB_OUTPUT
- uses: simonswine/hetzner-github-runner@HEAD
if: "${{ steps.cache-status.outputs.cache-status == 'notBuilt' }}"
with:
github-api-key: ${{ secrets.GH_API_KEY_RUNNER }}
hetzner-api-key: ${{ secrets.HETZNER_API_KEY }}
hetzner-instance-type: cax21
build-arm64:
if: "${{ needs.prepare-arm64-runner.outputs.cache-status == 'notBuilt' }}"
runs-on: self-hosted
needs: prepare-arm64-runner
steps:
- uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-24.05
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: cachix/cachix-action@v15
with:
name: packer-kubernetes-hcloud
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- uses: actions/checkout@v4
- run: nix build '.#nixosConfigurations.install-image-orangepi5plus.config.system.build.toplevel'