Github action to use an Attic binary cache https://cachix.org
  • TypeScript 67.8%
  • Nix 26.9%
  • JavaScript 5.3%
Find a file
Domen Kožar 38dc1a956d
Merge pull request #66 from cachix/auth-token-push
allow auth token to be enough for pushing paths
2020-11-10 14:27:53 +01:00
.github bump install-nix-action to v12 2020-11-04 15:49:54 +01:00
dist/main allow auth token to be enough for pushing paths 2020-11-10 14:20:48 +01:00
src allow auth token to be enough for pushing paths 2020-11-10 14:20:48 +01:00
.gitignore bundle all the dependencies 2020-04-10 14:55:10 +02:00
action.yml add installCommand option 2020-08-26 21:18:01 +02:00
jest.config.js Initial commit 2019-09-30 15:32:36 +02:00
LICENSE Split Nix installation into separate action 2019-10-02 16:25:24 +02:00
package.json chore(deps): bump @actions/core from 1.2.3 to 1.2.6 2020-10-01 17:20:47 +00:00
README.md README: clarify on security 2020-07-29 11:59:30 +02:00
shell.nix add shell.nix for development 2020-04-16 05:18:25 +01:00
test-with-arg.nix Add nixBuildArgs parameter 2020-02-27 16:46:25 +01:00
test.nix install-nix-action v11 2020-09-21 16:58:28 +02:00
tsconfig.json Initial commit 2019-09-30 15:32:36 +02:00
yarn.lock chore(deps): bump @actions/core from 1.2.3 to 1.2.6 2020-10-01 17:20:47 +00:00

cachix-action

github actions badge

One nice benefit of Nix is that CI can build and cache developer environments for every project on every branch using binary caches.

Another important aspect of CI is the feedback loop of how many minutes does the build take to finish.

With a simple configuration using Cachix, youll never have to build any derivation twice and share them with all your developers.

After each job, just built derivations are pushed to your binary cache.

Before each job, derivations to be built are first substituted (if they exist) from your binary cache.

Getting started

Follow Continuous Integration with GitHub Actions tutorial.

See action.yml for all options.

Security

Cachix auth token and signing key need special care as they give read and write access to your caches.

As per GitHub Actions' security model:

Anyone with write access to a repository can create, read, and use secrets.

Which means all developers with write/push access can read your secrets and write to your cache.

Pull requests do not have access to secrets so read access to a public binary cache will work, but pushing will be disabled since there is no signing key.

Note that malicious code submitted via a pull request can, once merged into master, reveal the tokens.

Hacking

Install the dependencies

$ yarn install

Build the typescript

$ yarn build

Run the tests ✔️

$ yarn test