fix: add retry logic for flaky cache.nixos.org
Some checks failed
Build and Push OCI Image / build (push) Failing after 1m12s

Build can fail with EOF errors when fetching from cache.
Add fallback to build from source if cache fails.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Christopher Mühl 2026-02-27 00:35:40 +01:00
parent c32ba4d80e
commit 8e2a0337e9
No known key found for this signature in database
GPG key ID: 925AC7D69955293F

View file

@ -16,9 +16,16 @@ jobs:
- name: Build OCI image - name: Build OCI image
run: | run: |
# Try with cache first, fall back to building from source
nix build .#solidhaus-image \ nix build .#solidhaus-image \
--print-build-logs \ --print-build-logs \
--show-trace --show-trace || {
echo "Build failed, retrying with --no-substitute to build from source..."
nix build .#solidhaus-image \
--print-build-logs \
--show-trace \
--option substitute false
}
- name: Push to registry - name: Push to registry
if: github.ref == 'refs/heads/main' if: github.ref == 'refs/heads/main'