gh-actions

Configure your github actions CI/CD

type

attribute set of (submodule)

default

{
  gh-actions = { };
}

gh-actions.<name>.enable

Whether to enable Github Actions CI-CD.

type

boolean

example

{
  gh-actions.<name>.enable = true;
}

default

{
  gh-actions.<name>.enable = false;
}

gh-actions.<name>.build

Command to run as build step

type

null or non-empty string

example

{
  gh-actions.<name>.build = "npm run build";
}

default

{
  gh-actions.<name>.build = null;
}

gh-actions.<name>.cache

CACHIX binary cache configuration

type

null or (submodule)

example

{
  gh-actions.<name>.cache = {
    key-name = "CACHIX_SIGNING_KEY";
    name = "MyCACHIXCacheName";
  };
}

default

{
  gh-actions.<name>.cache = null;
}

gh-actions.<name>.cache.key-name

Name of GH Secret with CACHIX SIGNING KEY

type

null or non-empty string

example

{
  gh-actions.<name>.cache.key-name = "CACHIX_SIGNING_KEY";
}

default

{
  gh-actions.<name>.cache.key-name = null;
}

gh-actions.<name>.cache.name

Name of your cache in CACHIX

type

non-empty string

example

{
  gh-actions.<name>.cache.name = "MyCACHIXCacheName";
}

default

{
  gh-actions.<name>.cache.name = null;
}

gh-actions.<name>.cache.token-name

Name of GH Secret with CACHIX AUTH TOKEN

type

null or non-empty string

example

{
  gh-actions.<name>.cache.token-name = "CACHIX_AUTH_TOKEN";
}

default

{
  gh-actions.<name>.cache.token-name = "CACHIX_AUTH_TOKEN";
}

gh-actions.<name>.deploy

Command to run as deploy step

type

null or non-empty string

example

{
  gh-actions.<name>.deploy = "aws s3 sync ./build s3://my-bucket";
}

default

{
  gh-actions.<name>.deploy = null;
}

gh-actions.<name>.env

env vars for steps

type

submodule

default

{
  gh-actions.<name>.env = { };
}

gh-actions.<name>.env.build

Env variable used by steps

type

attribute set of string

example

{
  gh-actions.<name>.env.build = {
    GIPHY_TOKEN = "\${{ secret.GH_ACTIONS_SSH_KEY }}";
  };
}

default

{
  gh-actions.<name>.env.build = { };
}

gh-actions.<name>.env.deploy

Env variable used by steps

type

attribute set of string

example

{
  gh-actions.<name>.env.deploy = {
    GIPHY_TOKEN = "\${{ secret.GH_ACTIONS_SSH_KEY }}";
  };
}

default

{
  gh-actions.<name>.env.deploy = { };
}

gh-actions.<name>.env.post-deploy

Env variable used by steps

type

attribute set of string

example

{
  gh-actions.<name>.env.post-deploy = {
    GIPHY_TOKEN = "\${{ secret.GH_ACTIONS_SSH_KEY }}";
  };
}

default

{
  gh-actions.<name>.env.post-deploy = { };
}

gh-actions.<name>.env.pre-build

Env variable used by steps

type

attribute set of string

example

{
  gh-actions.<name>.env.pre-build = {
    GIPHY_TOKEN = "\${{ secret.GH_ACTIONS_SSH_KEY }}";
  };
}

default

{
  gh-actions.<name>.env.pre-build = { };
}

gh-actions.<name>.env.test

Env variable used by steps

type

attribute set of string

example

{
  gh-actions.<name>.env.test = {
    GIPHY_TOKEN = "\${{ secret.GH_ACTIONS_SSH_KEY }}";
  };
}

default

{
  gh-actions.<name>.env.test = { };
}

gh-actions.<name>.gha-cache

GH Action Cache configuration By default it caches only ~/.cache/nix

type

null or (submodule)

example

{
  gh-actions.<name>.gha-cache = {
    name = "My cache";
  };
}

default

{
  gh-actions.<name>.gha-cache = null;
}

gh-actions.<name>.gha-cache.id

Id to be used in action

type

non-empty string

example

{
  gh-actions.<name>.gha-cache.id = "my-cache";
}

default

{
  gh-actions.<name>.gha-cache.id = "cache";
}

gh-actions.<name>.gha-cache.key

Key to used in this cache

type

non-empty string

example

{
  gh-actions.<name>.gha-cache.key = "nix-\${{ runner.os }}-\${{ hashFiles('flake.lock') }}";
}

default

{
  gh-actions.<name>.gha-cache.key = "nix-\${{ runner.os }}-\${{ hashFiles('flake.lock') }}";
}

gh-actions.<name>.gha-cache.name

Name to be used in this action

type

non-empty string

example

{
  gh-actions.<name>.gha-cache.name = "My Cache";
}

default

{
  gh-actions.<name>.gha-cache.name = "Cache";
}

gh-actions.<name>.gha-cache.paths

Other paths to cache

type

list of non-empty string

example

{
  gh-actions.<name>.gha-cache.paths = [
    "~/.cache/nim"
  ];
}

default

{
  gh-actions.<name>.gha-cache.paths = [
    "~/.cache/nix"
  ];
}

gh-actions.<name>.gha-cache.uses

Cache version, default is actions/cache@4

type

non-empty string

example

{
  gh-actions.<name>.gha-cache.uses = "actions/cache@v4";
}

default

{
  gh-actions.<name>.gha-cache.uses = "actions/cache@v4";
}

gh-actions.<name>.on

When this build should be triggered

type

attribute set of anything

example

{
  gh-actions.<name>.on = {
    push = {
      branches = [
        "master"
      ];
    };
  };
}

default

{
  gh-actions.<name>.on = {
    push = {
      branches = [
        "master"
      ];
    };
  };
}

gh-actions.<name>.post-deploy

Command that run after deploy

type

null or non-empty string

example

{
  gh-actions.<name>.post-deploy = "echo Im done";
}

default

{
  gh-actions.<name>.post-deploy = null;
}

gh-actions.<name>.pre-build

Command to run before build

type

null or non-empty string

example

{
  gh-actions.<name>.pre-build = "npm i";
}

default

{
  gh-actions.<name>.pre-build = null;
}

gh-actions.<name>.ssh

https://github.com/marketplace/actions/install-ssh-key Config for ssh installation There are two reasons to set it

  1. our deploy runs in ssh
  2. we have some private git repository

In this last case we should add your public key to some user with repository access (in github) or to our private server.

type

null or (attribute set of string)

example

{
  gh-actions.<name>.ssh = {
    key = "\${{ secret.GH_ACTIONS_SSH_KEY }}";
  };
}

default

{
  gh-actions.<name>.ssh = null;
}

gh-actions.<name>.ssh-secret-name

Name of GH Secret with PRIVATE SSH KEY for more advanced usage try ssh option

type

null or non-empty string

example

{
  gh-actions.<name>.ssh-secret-name = "GH_ACTIONS_SSH_KEY";
}

default

{
  gh-actions.<name>.ssh-secret-name = null;
}

gh-actions.<name>.test

Command to run as test step

type

null or non-empty string

example

{
  gh-actions.<name>.test = "npm test";
}

default

{
  gh-actions.<name>.test = null;
}