-
Notifications
You must be signed in to change notification settings - Fork 5
63 lines (59 loc) · 2.46 KB
/
check-external-links.yml
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Check external links
on:
push:
branches:
[ main ]
schedule: ## Do a run once times daily, to catch new regressions
- cron: '45 10 * * *'
workflow_dispatch:
defaults:
run:
shell: bash
concurrency:
group: ${{ github.workflow }} # do not allow any concurrency or the different builds will risk creating multiple issues
jobs:
build:
runs-on: ubuntu-latest
permissions:
issues: write
repository-projects: read
statuses: read
steps:
- uses: actions/checkout@v3
- name: Restoring cached GitHub API results
uses: actions/cache@v3
with:
path: |
.cache-github-api
key: gatsby-build-github-queries-${{ steps.date.outputs.month }}-${{ steps.date.outputs.day }}-${{ github.run_id }}-${{ github.run_attempt }}
restore-keys: | # If there are multiple partial matches for a restore key, the action returns the most recently created cache.
gatsby-build-github-queries-${{ steps.date.outputs.month }}-${{ steps.date.outputs.day }}
gatsby-build-github-queries-
- uses: actions/setup-node@v3
with:
node-version: '18'
cache: "npm" # this only caches global dependencies
- run: npm ci --prefer-offline
- run: npm run build -- ${{ github.ref_name == 'main' && '--prefix-paths' || '' }}
env:
NODE_ENV: production
GATSBY_ACTIVE_ENV: production
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SEGMENT_KEY: ${{ secrets.SEGMENT_KEY }}
- name: Caching GitHub API results
uses: actions/cache/save@v3 # save the cache even if the integration tests fail
with:
path: |
.cache-github-api
key: gatsby-build-github-queries-${{ steps.date.outputs.month }}-${{ steps.date.outputs.day }}-${{ github.run_id }}-${{ github.run_attempt }}
- run: npm run test:links
env:
CI: true
PATH_PREFIX: "${{ github.ref_name == 'main' && 'extensions' || '' }}"
PATH_PREFIX_FLAG: "${{ github.ref_name == 'main' && '--prefix-paths' || '' }}"
- name: Raise defects if needed
uses: jbangdev/jbang-action@v0.111.0
if: always() # we *especially* want to run this if the link checker failed
with:
script: util/dead-link-issue.java
scriptargs: token=${{ secrets.GITHUB_TOKEN }} issueRepo=${{ github.repository }} runId=${{ github.run_id }} siteUrl=https://quarkus.io/extensions