-
Notifications
You must be signed in to change notification settings - Fork 370
76 lines (69 loc) · 2.33 KB
/
flowzone.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
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Flowzone
on:
pull_request:
types: [opened, synchronize, closed]
branches: [main, master]
# allow external contributions to use secrets within trusted code
pull_request_target:
types: [opened, synchronize, closed]
branches: [main, master]
jobs:
flowzone:
name: Flowzone
uses: product-os/flowzone/.github/workflows/flowzone.yml@master
# prevent duplicate workflow executions for pull_request and pull_request_target
if: |
(
github.event.pull_request.head.repo.full_name == github.repository &&
github.event_name == 'pull_request'
) || (
github.event.pull_request.head.repo.full_name != github.repository &&
github.event_name == 'pull_request_target'
)
secrets: inherit
with:
cloudflare_website: "balenacloud-docs"
docusaurus_website: false
link-checker:
name: Check links in pull request
runs-on: ubuntu-latest
needs: flowzone
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false
# fetch external files && building the docs
- name: Build the docs
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65
with:
node-version: 18
- run: npm run deploy-docs
- name: Restore lychee cache
id: restore-cache
if: |
github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
uses: actions/cache/restore@v3
with:
path: .lycheecache
key: cache-lychee-${{ github.sha }}
restore-keys: cache-lychee-
# Run link checker on the generated HTML
- name: Link Checker
id: lychee
uses: lycheeverse/lychee-action@2b973e86fc7b1f6b36a93795fe2c9c6ae1118621 # for v1.10.0
env:
DEPLOYMENT_URL: ${{ needs.flowzone.outputs.cloudflare_deployment_url || 'https://docs.balena.io' }}
with:
args: >
-qq
--base ${{ env.DEPLOYMENT_URL }}
--config ./lychee.toml
"build/**/*" "tools/fetch-external.sh"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Save lychee cache
uses: actions/cache/save@v3
if: always()
with:
path: .lycheecache
key: ${{ steps.restore-cache.outputs.cache-primary-key }}