Skip to content

Commit

Permalink
Merge pull request #15 from dataheld/cache-2-flakehub
Browse files Browse the repository at this point in the history
cache to flakehub
  • Loading branch information
grahamc authored Feb 12, 2025
2 parents 20e42e9 + a334c16 commit 13124e4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
- uses: DeterminateSystems/nix-installer-action@main
with:
flakehub: true
- uses: DeterminateSystems/magic-nix-cache-action@main
- uses: DeterminateSystems/flakehub-cache-action@main
- uses: webfactory/[email protected]
if: ${{ inputs.enable-ssh-agent }}
with:
Expand Down Expand Up @@ -104,7 +104,7 @@ jobs:
- uses: DeterminateSystems/nix-installer-action@main
with:
flakehub: true
- uses: DeterminateSystems/magic-nix-cache-action@main
- uses: DeterminateSystems/flakehub-cache-action@main
- uses: webfactory/[email protected]
if: ${{ inputs.enable-ssh-agent }}
with:
Expand Down Expand Up @@ -142,7 +142,7 @@ jobs:
if: ${{ !github.repository.fork && inputs.visibility != '' && (github.ref == format('refs/heads/{0}', inputs.default-branch) || startsWith(github.ref, 'refs/tags/')) }}
with:
flakehub: true
- uses: DeterminateSystems/magic-nix-cache-action@main
- uses: DeterminateSystems/flakehub-cache-action@main
if: ${{ !github.repository.fork && inputs.visibility != '' && (github.ref == format('refs/heads/{0}', inputs.default-branch) || startsWith(github.ref, 'refs/tags/')) }}
- uses: "DeterminateSystems/flakehub-push@main"
if: ${{ !github.repository.fork && inputs.visibility != '' && (github.ref == format('refs/heads/{0}', inputs.default-branch) || startsWith(github.ref, 'refs/tags/')) }}
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,20 @@ jobs:
visibility: public
```
### Caching
To speed up builds, the workflow uses [FlakeHub Cache](https://flakehub.com/cache) as a cache.
> [!NOTE]
> FlakeHub Cache only works if you're on a paid plan.
If you're not signed up for FlakeHub, the workflow will still pass, but may be slower.
In this case, your logs will include a warning like this:
```
ERROR magic_nix_cache: FlakeHub cache initialization failed: FlakeHub cache error: HTTP 401 Unauthorized: "User is not authorized for this resource."
```
### Advanced Usage
#### Custom Runner Types
Expand Down

0 comments on commit 13124e4

Please sign in to comment.