Welcome to the new unified Determinate docs experience!
GuidesEasy caching with Determinate CI

Easy caching with Determinate CI

Determinate Systems provides a [GitHub Action][actions] called [Determinate CI][ci] that you can use to streamline pushing artifacts to FlakeHub Cache.

Pushing all flake outputs to FlakeHub Cache

You can push all of the outputs from a flake to FlakeHub Cache by adding an Actions configuration like this to your repo:

.github/workflows/determinate-ci.yml
on:
  pull_request:
  workflow_dispatch:
  push:
    branches:
      - main
      - master
    tags:
      - v?[0-9]+.[0-9]+.[0-9]+*
 
concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
  cancel-in-progress: true
 
jobs:
  DeterminateCI:
    uses: DeterminateSystems/ci/.github/workflows/workflow.yml@main
    permissions:
      id-token: write
      contents: read

This Action automatically:

  • Discovers all Nix derivation outputs—packages, devShells, nixosConfigurations, and more—on all architectures your flake supports using Flake Schemas.
  • Builds all derivation outputs on appropriate Actions runners and uses the Magic Nix Cache to push to FlakeHub Cache.
  • Publishes your flake releases to FlakeHub.

Publishing your flake to FlakeHub

If you’d like to publish your flake to FlakeHub after your builds are complete, you can specify the visibility of the flake in your configuration:

.github/workflows/determinate-ci.yml
jobs:
  DeterminateCI:
    uses: DeterminateSystems/ci/.github/workflows/workflow.yml@main
    permissions:
      id-token: "write"
      contents: "read"
    with:
      visibility: public