cq-flake icon indicating copy to clipboard operation
cq-flake copied to clipboard

Add a cachix cache

Open calops opened this issue 10 months ago • 4 comments

Seeing the github actions that are already used, it would be pretty trivial to add a step that uploads the built artifacts to a public cachix cache. This would remove the need for people to build everything themselves after each update.

calops avatar Jan 05 '25 14:01 calops

it would be pretty trivial

Just a lurker here, but doing anything interesting in github actions is rarely trivial if you haven't done it before. If you're familiar with the workflow, make a PR? Agreed that this would be valuable.

Ralith avatar Jan 05 '25 21:01 Ralith

I'm sorry, I didn't want to sound presumptuous. I'm willing to draft a PR but the project owner needs to create an account on cachix themselves and add the credentials in GitHub secrets.

calops avatar Jan 05 '25 21:01 calops

I'm not a maintainer, but that does sound helpful!

Ralith avatar Jan 05 '25 21:01 Ralith

For reference, I tried setting this up and it was pretty straightforward: https://github.com/justbuchanan/cq-flake/blob/main/.github/workflows/cachix.yml.

Steps:

  1. make a cachix account
  2. click "Create Cache" and give it a name
  3. in cache Settings -> Auth Tokens, click "Generate"
  4. Add the token to the github project under Settings -> Secrets and variables -> Actions -> Repository secrets
  5. Add the relevant cachix bits to the github actions workflow (see link above)

The first build took a very long time as expected, but the next build was under two minutes.

justbuchanan avatar Oct 24 '25 22:10 justbuchanan