-
Notifications
You must be signed in to change notification settings - Fork 1.1k
109 lines (96 loc) · 3.48 KB
/
website.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: website
on:
push:
branches:
- 'main'
- 'release-**'
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
branches:
- 'main'
- 'release-**'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
changes:
outputs:
should-run-link-check: ${{ steps.changes.outputs.src == 'true' }}
if: github.event.pull_request.draft == false
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
id: changes
with:
filters: |
src:
- '**.js'
- 'package-lock.json'
- 'package.json'
- '.github/workflows/website.yml'
# Check that the website builds and there's no missing links.
# This job builds the website, starts a server to serve it, and then uses
# muffet (https://github.com/raviqqe/muffet) to perform the link check.
link-check:
needs: [changes]
if: github.event.pull_request.draft == false && needs.changes.outputs.should-run-link-check == 'true'
name: Website Link Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: markdown-lint
uses: DavidAnson/markdownlint-cli2-action@b4c9feab76d8025d1e83c653fa3990936df0e6c8 # v16
with:
config: .markdownlint.yaml
globs: 'runatlantis.io/**/*.md'
- name: setup npm
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4
with:
node-version: '20'
cache: 'npm'
- name: run http-server
env:
# renovate: datasource=github-releases depName=raviqqe/muffet
MUFFET_VERSION: 2.10.3
run: |
# install raviqqe/muffet to check for broken links.
curl -Ls https://github.com/raviqqe/muffet/releases/download/v${MUFFET_VERSION}/muffet_linux_amd64.tar.gz | tar -xz
# build site
npm install
npm run website:build
# start http-server for integration testing
npx http-server runatlantis.io/.vitepress/dist &
- name: Run Playwright E2E tests
run: |
npx playwright install --with-deps
npm run e2e
- name: wait until server listened
run: curl --retry-delay 1 --retry 30 --retry-all-error http://localhost:8080
# medium.com => was being rate limited: HTTP 429
# twitter.com => too many redirections
# www.flaticon.com => 403 error
- run: |
./muffet \
-e 'https://medium.com/runatlantis' \
-e 'https://dev.to/*' \
-e 'https://twitter.com/*' \
-e 'https://www.flaticon.com/*' \
-e 'https://github\.com/runatlantis/atlantis/edit/main/.*' \
-e 'https://github.com/runatlantis/helm-charts#customization' \
-e 'https://github.com/sethvargo/atlantis-on-gke/blob/master/terraform/tls.tf#L64-L84' \
-e 'https://confluence.atlassian.com/*' \
--header 'Accept-Encoding:deflate, gzip' \
--buffer-size 8192 \
http://localhost:8080/
skip-link-check:
needs: [changes]
if: needs.changes.outputs.should-run-link-check == 'false'
name: Website Link Check
runs-on: ubuntu-latest
steps:
- run: 'echo "No build required"'