Skip to content

Commit

Permalink
Skip building when already in cache
Browse files Browse the repository at this point in the history
  • Loading branch information
simonswine committed Nov 8, 2024
1 parent 81b6185 commit e527a9a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
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:
Expand All @@ -29,14 +31,18 @@ jobs:
name: packer-kubernetes-hcloud
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- uses: actions/checkout@v4
- run: nix run nixpkgs#nix-eval-jobs -- --gc-roots-dir gcroot --check-cache-status --flake '.#nixosConfigurations.install-image-orangepi5plus.config.system.build.toplevel'
- run: nix-env -iA nixpkgs.nix-eval-jobs nixpkgs.jq
- 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_ENV"
- 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: false
if: "${{ needs.prepare-arm64-runner.outputs.cache-status == 'notBuilt' }}"
runs-on: self-hosted
needs: prepare-arm64-runner
steps:
Expand Down

0 comments on commit e527a9a

Please sign in to comment.