diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 832d0df..e85f420 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,9 +30,11 @@ jobs: working-directory: astro-site run: npm run build - # TODO: Fix lychee configuration for Astro's base path and fragment links (#121) - # - name: Check links - # uses: lycheeverse/lychee-action@v2 - # with: - # args: --base ${{ github.workspace }}/astro-site/dist --root-dir ${{ github.workspace }}/astro-site/dist astro-site/dist - # fail: true + - name: Create base path symlink for link checker + run: ln -s . astro-site/dist/tutorial-git + + - name: Check links + uses: lycheeverse/lychee-action@v2 + with: + args: --root-dir astro-site/dist --config lychee.toml 'astro-site/dist/**/*.html' + fail: true diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 0d77dc6..7ef4de3 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -39,12 +39,14 @@ jobs: working-directory: astro-site run: npm run build - # TODO: Fix lychee configuration for Astro's base path and fragment links (#121) - # - name: Check links - # uses: lycheeverse/lychee-action@v2 - # with: - # args: --base ${{ github.workspace }}/astro-site/dist --root-dir ${{ github.workspace }}/astro-site/dist astro-site/dist - # fail: true + - name: Create base path symlink for link checker + run: ln -s . astro-site/dist/tutorial-git + + - name: Check links + uses: lycheeverse/lychee-action@v2 + with: + args: --root-dir astro-site/dist --config lychee.toml 'astro-site/dist/**/*.html' + fail: true - name: Upload artifact uses: actions/upload-pages-artifact@v3 diff --git a/lychee.toml b/lychee.toml new file mode 100644 index 0000000..8f3d6c5 --- /dev/null +++ b/lychee.toml @@ -0,0 +1,13 @@ +# Lychee link checker configuration +# Runs against the Astro build output in astro-site/dist/ + +# Exclude external URLs to keep CI fast and deterministic +exclude = [ + "^https://", + "^http://", +] + +# Accept 200 and 204 +accept = [200, 204] + +no_progress = true