Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

github-actions

Reusable GitHub Actions shared across GenLayer repositories.

License: MIT

Background

Every GenLayer repository that builds with Nix needs the same two steps: install Nix pointed at our substituters, and push what it built to the shared binary cache. Keeping one copy here means a change to the cache endpoint, a key rotation, or a pinned installer bump lands in one place instead of nine.

The same goes for GitHub App tokens. A pull request opened with the workflow's own GITHUB_TOKEN starts no workflows, so a bot that opens PRs needs an App token, and the App's key lives in AWS SSM, GCP Secret Manager or a repository secret depending on the repository. app-token reads it from any of them.

Install

Nothing to install — reference an action by path and ref:

- uses: genlayerlabs/github-actions/nix-setup@main

@main can be used alongside SHA, including for jobs that hold a push token. It is a mutable ref, but main here is protected — creations, updates and deletions are restricted, and it only advances through a reviewed pull request — so moving it costs the same as merging. A SHA pin does not add much value here; see versioning.md.

Third-party actions are a different matter and stay pinned by SHA, which is why nix-setup pins cachix/install-nix-action that way.

Usage

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5

      - uses: genlayerlabs/github-actions/nix-setup@main
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          cache_pull_token: ${{ secrets.NIX_CACHE_PULL_TOKEN }}

      - run: nix build

      # Not `success()`: a job that failed late still built most of the closure,
      # and that is exactly the work a retry should not repeat.
      - if: ${{ !cancelled() }}
        uses: genlayerlabs/github-actions/nix-cache-push@main
        with:
          token: ${{ secrets.NIX_CACHE_PUSH_TOKEN }}
Action Purpose
nix-setup install Nix, wire up substituters and cache auth
nix-cache-push upload locally-built paths to the cache
app-token GitHub App token, key read from a secret, AWS SSM or GCP

An App token, with the key in the repository's own secrets:

- id: app-token
  uses: genlayerlabs/github-actions/app-token@main
  with:
    client_id: ${{ vars.PR_BOT_CLIENT_ID }}
    private_key: ${{ secrets.PR_BOT_PRIVATE_KEY }}

- run: gh pr create --fill
  env:
    GH_TOKEN: ${{ steps.app-token.outputs.token }}

The cache is private — nix-setup needs cache_pull_token or it will build everything from source. See nix-cache.md for what the tokens are, how to get one, and how to configure the same cache on your own machine.

Full input reference: actions.md.

Contributing

See docs/contributing/.

License

MIT © 2026 GenLayer

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages