ci: migrate to vm based runners #129

Merged
JakeHillion merged 1 commits from jj/qmspqzprplvz into main 2026-05-06 18:52:28 +01:00
Showing only changes of commit 5719276a8f - Show all commits
+14 -33
View File
@@ -5,29 +5,32 @@ on:
jobs: jobs:
nix: nix:
runs-on: ubuntu-latest runs-on: ubuntu-26.04-vm
steps: steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Shim sudo for rootless runners
run: |
printf '#!/bin/sh\nexec "$@"' > /tmp/sudo
chmod +x /tmp/sudo
echo /tmp >> "$GITHUB_PATH"
- uses: cachix/install-nix-action@616559265b40713947b9c190a8ff4b507b5df49b # v31 - uses: cachix/install-nix-action@616559265b40713947b9c190a8ff4b507b5df49b # v31
with: with:
extra_nix_config: | install_options: --yes
accept-flake-config = true
extra-substituters = https://nixcache.jakehillion.me - name: Setup Nix S3 cache
extra-trusted-public-keys = nixcache.jakehillion.me-1:HQsjYdrcs3ilS/ngtlbTQXU4Xfsm+va5NN7yoK0wKMg= uses: testquorum/nix-s3-generations@08090ea0b9ce0eab04ba614d887c55bdaa0a6f52 # v0.1.3
with:
s3-endpoint: 28e45df51086264c6d9cf2b5e6ecc190.r2.cloudflarestorage.com
bucket: jakehillion-nix
region: auto
aws-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }}
public-key: "nixcache.jakehillion.me-1:HQsjYdrcs3ilS/ngtlbTQXU4Xfsm+va5NN7yoK0wKMg="
private-key: ${{ secrets.NIX_SIGNING_KEY }}
- uses: nicknovitski/nix-develop@9be7cfb4b10451d3390a75dc18ad0465bed4932a # v1 - uses: nicknovitski/nix-develop@9be7cfb4b10451d3390a75dc18ad0465bed4932a # v1
with: with:
arguments: .#ci arguments: .#ci
- name: Build all outputs - name: Build all outputs
run: nix-fast-build --no-nom --skip-cached --flake '.#ci' run: nix-fast-build --no-nom --flake '.#ci'
- name: Prepare test archive - name: Prepare test archive
run: | run: |
@@ -44,25 +47,3 @@ jobs:
- name: Flake check - name: Flake check
run: nix flake check run: nix flake check
- name: Sign and push to cache
if: always()
run: |
if [ -z "$SIGNING_KEY" ]; then
echo "No signing key available; skipping sign+push."
exit 0
fi
echo "$SIGNING_KEY" > /tmp/nix-signing-key
trap 'rm -f /tmp/nix-signing-key' EXIT
paths=$(nix path-info --all --json \
| jq -r 'to_entries[] | select(.value.ultimate == true) | .key')
if [ -z "$paths" ]; then
echo "No ultimate paths to sign; skipping."
exit 0
fi
echo "$paths" | xargs nix store sign --key-file /tmp/nix-signing-key
echo "$paths" | xargs nix copy --to 's3://jakehillion-nix?endpoint=https://28e45df51086264c6d9cf2b5e6ecc190.r2.cloudflarestorage.com&region=auto'
env:
SIGNING_KEY: ${{ secrets.NIX_SIGNING_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}