about summary refs log tree commit diff
path: root/.github/workflows/check-links.yaml
blob: ea2095245ecc6eeeb5e85aa057fbca04a58e8857 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Check links
on:
  schedule:
    - cron: "30 6 * * 0"
  workflow_dispatch:
  pull_request:
    branches:
      - main
jobs:
  lychee:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: DeterminateSystems/nix-installer-action@main
      - uses: DeterminateSystems/magic-nix-cache-action@main
      - name: Build the site
        run: nix build --print-build-logs
      - name: Restore lychee cache
        uses: actions/cache@v3
        with:
          path: .lycheecache
          key: cache-lychee-${{ hashFiles('**/*.md') }}
          restore-keys: cache-lychee-
      - name: Check links
        id: lychee
        uses: lycheeverse/lychee-action@v1
        with:
          args: --verbose --no-progress './result/**/*.html'
          output: ./lycheeresult.md
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      - name: Create issue
        if: ${{ github.event_name != 'pull_request' && env.lychee_exit_code != 0 }}
        uses: peter-evans/create-issue-from-file@v4
        with:
          title: "[lychee] Broken links"
          content-filepath: ./lycheeresult.md
          labels: bug, automated issue