configuration.nix/.github/workflows/check.yml

53 lines
1.7 KiB
YAML
Raw Normal View History

2024-01-14 17:59:46 +01:00
name: Check flake
on:
push:
branches: [main]
path:
- ./**.nix
- ./flake.lock
2024-01-14 17:59:46 +01:00
pull_request:
jobs:
check:
2024-07-29 09:52:42 +02:00
runs-on: ubuntu-latest
2024-01-14 17:59:46 +01:00
steps:
2025-03-09 12:40:15 +01:00
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: DeterminateSystems/nix-installer-action@v13
with:
source-url: "https://install.lix.systems/lix/lix-installer-x86_64-linux"
diagnostic-endpoint: ""
2025-03-09 12:40:15 +01:00
- uses: DeterminateSystems/magic-nix-cache-action@6221693898146dc97e38ad0e013488a16477a4c4 # v9
2024-01-14 17:59:46 +01:00
- name: Run `nix flake check`
2024-05-20 14:14:11 +02:00
run: |
2024-07-29 09:52:42 +02:00
nix flake check --verbose --keep-going
2024-05-20 14:14:11 +02:00
nix run nixpkgs#statix -- check .
build-docs:
runs-on: ubuntu-latest
steps:
2025-03-09 12:40:15 +01:00
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: DeterminateSystems/magic-nix-cache-action@6221693898146dc97e38ad0e013488a16477a4c4 # v9
- uses: DeterminateSystems/nix-installer-action@v13
with:
source-url: "https://install.lix.systems/lix/lix-installer-x86_64-linux"
diagnostic-endpoint: ""
2024-07-29 09:52:42 +02:00
- name: Build documentation
run: nix build .#docs --print-build-logs
- name: Upload artifact
2025-03-09 12:40:15 +01:00
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3
2024-07-29 09:52:42 +02:00
with:
path: ./result
deploy-docs:
runs-on: ubuntu-latest
needs: build-docs
2024-02-18 17:04:46 +01:00
if: ${{ github.event_name == 'push' }} # only run on main branch
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
2025-03-09 12:40:15 +01:00
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4