2024-01-14 17:59:46 +01:00
|
|
|
name: Check flake
|
|
|
|
on:
|
|
|
|
push:
|
2024-02-02 14:59:13 +01:00
|
|
|
branches: [main]
|
2024-01-14 19:30:10 +01:00
|
|
|
path:
|
|
|
|
- ./**.nix
|
|
|
|
- ./flake.lock
|
2024-01-14 17:59:46 +01:00
|
|
|
pull_request:
|
|
|
|
schedule:
|
|
|
|
- cron: 5 4 * * 5 # At 04:05 on Friday.
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
check:
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
2024-02-02 15:13:08 +01:00
|
|
|
- uses: actions/checkout@v4
|
2024-03-17 00:31:26 +01:00
|
|
|
- uses: DeterminateSystems/nix-installer-action@v10
|
2024-03-17 00:35:40 +01:00
|
|
|
- uses: DeterminateSystems/magic-nix-cache-action@v4
|
2024-01-14 17:59:46 +01:00
|
|
|
- name: Run `nix flake check`
|
2024-05-20 14:14:11 +02:00
|
|
|
run: |
|
|
|
|
nix flake check
|
|
|
|
nix run nixpkgs#statix -- check .
|
2024-01-14 17:59:46 +01:00
|
|
|
lockfile:
|
2024-02-18 16:51:03 +01:00
|
|
|
runs-on: ubuntu-22.04
|
2024-01-14 17:59:46 +01:00
|
|
|
needs: check
|
|
|
|
if: ${{ github.event_name == 'schedule' }} # only run when scheduled
|
|
|
|
steps:
|
2024-02-02 15:13:08 +01:00
|
|
|
- uses: actions/checkout@v4
|
2024-03-17 00:31:26 +01:00
|
|
|
- uses: DeterminateSystems/nix-installer-action@v10
|
2024-03-01 08:51:29 +01:00
|
|
|
- uses: DeterminateSystems/update-flake-lock@v21
|
2024-01-14 17:59:46 +01:00
|
|
|
- name: Run `nix flake check`
|
|
|
|
run: nix flake check
|
2024-02-18 16:51:03 +01:00
|
|
|
build-documentation:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
if: ${{ github.event_name != 'schedule' }} # only run when not scheduled
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
2024-03-17 00:31:26 +01:00
|
|
|
- uses: DeterminateSystems/nix-installer-action@v10
|
|
|
|
- uses: DeterminateSystems/magic-nix-cache-action@v4
|
2024-02-18 16:51:03 +01:00
|
|
|
- name: Build documentation
|
|
|
|
run: nix build .#docs --print-build-logs
|
|
|
|
- name: Upload artifact
|
2024-03-09 00:05:05 +01:00
|
|
|
uses: actions/upload-pages-artifact@v3
|
2024-02-18 16:51:03 +01:00
|
|
|
with:
|
|
|
|
path: ./result
|
|
|
|
deploy:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: build-documentation
|
2024-02-18 17:04:46 +01:00
|
|
|
if: ${{ github.event_name == 'push' }} # only run on main branch
|
2024-02-18 16:51:03 +01:00
|
|
|
permissions:
|
|
|
|
pages: write
|
|
|
|
id-token: write
|
|
|
|
environment:
|
|
|
|
name: github-pages
|
|
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
|
|
steps:
|
|
|
|
- name: Deploy to GitHub Pages
|
|
|
|
id: deployment
|
2024-03-09 00:05:05 +01:00
|
|
|
uses: actions/deploy-pages@v4
|