Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI integration - Github Actions #132

Open
adisbladis opened this issue Nov 6, 2023 · 0 comments
Open

CI integration - Github Actions #132

adisbladis opened this issue Nov 6, 2023 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@adisbladis
Copy link
Member

There should be a quick & easy way to get Github Actions to publish Nix builds to a log instance running elsewhere.

This integration will take care of:

  • Integrating with the system Nix installation, however it was installed.
  • Integration of the write token into github actions yaml syntax.
  • Using Github Actions secrets for write token.

Considerations:

  • It's probably worth it to not install the push as a post-build-hook but as a post action step
    Instead of slowing down and doing a network round trip after every build we can do one big submission in one big chunk.
    Not only is this better for less round trips, but it also means that we can possibly publish fewer STHs (signed tree heads).

Hosting:

Notably this action does not take care of hosting a Trustix instance.
That's still an exercise left up to the user.

Example usage:

name: "Test"
on:
  pull_request:
  push:
jobs:
  tests:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - uses: cachix/install-nix-action@v23
    - uses: nix-community/trustix/packages/trustix-nix/github-action@v1
      with:
        instance: https://demo.trustix.dev
        # Log ID as returned by `trustix -- print-log-id --protocol nix --pubkey $(cat secrets/log-pub)`
        logID: 453016597475f45532e0a22a448ea7e0fb915e950d3c8930bfd23d962d73f9c1
        # Write token
        token: '${{ secrets.TRUSTIX_WRITE_TOKEN }}'
    - run: nix-build
@adisbladis adisbladis added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant