Skip to content

Report check status and push to Cachix #23

Report check status and push to Cachix

Report check status and push to Cachix #23

Workflow file for this run

name: "Report check status and push to Cachix"
on:
workflow_dispatch:
push:
branches:
- "**"
jobs:
report-and-push:
runs-on: ubuntu-latest
env:
NIXPKGS_ALLOW_BROKEN: "1"
NIXPKGS_ALLOW_UNFREE: "1"
NIXPKGS_ALLOW_INSECURE: "1"
NIX_CONFIG: |
experimental-features = nix-command flakes
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
checks: write
steps:
- uses: actions/checkout@v6
- name: mount Nix store on larger partition
# on the Linux runner `/` doesn't have enough space, but there's a `/mnt` which does.
if: runner.os == 'Linux'
run: |
sudo mkdir /nix /mnt/nix
sudo mount --bind /mnt/nix /nix
- uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v17
with:
name: scarisey-public
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: Build default package
run: |
nix build --accept-flake-config .#packages.x86_64-linux.default
- name: Generate a token
id: generate-token
uses: actions/create-github-app-token@v3
with:
app-id: ${{ secrets.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
- name: Check OK
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/${{ github.repository }}/check-runs \
-f "name=check_ok" \
-f "head_sha=${{ github.sha }}" \
-f "status=completed" \
-f "conclusion=success"