-
Notifications
You must be signed in to change notification settings - Fork 189
49 lines (47 loc) · 1.8 KB
/
build-docs.yaml
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
name: build-docs
on: pull_request
jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 22
- name: Install Dependencies
run: npm ci
- name: Cache Docusaurus
uses: ./.github/actions/docusaurus-cache
- name: Build
run: npm run build
env:
NODE_OPTIONS: --max_old_space_size=8192
- name: Remove https redirect
run: |
sed -i '/SERVER_PORT/d;/SERVER_NAME/d' build/.htaccess
- name: Run web server
run: |
docker run -d --name webserver -v "$PWD/build":/app -p 8888:8080 bitnami/apache:2.4.54
echo "container_ip=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' webserver)" >> $GITHUB_ENV
- name: Download sitemap from production
run: curl -sL https://docs.camunda.io/sitemap.xml | grep -oP '<loc>\K.*?(?=</loc>)' | sed "s!https://docs.camunda.io!http://${{ env.container_ip }}:8080!g" > sitemap.prod.txt
- name: Prepare product links
run: grep 'https://docs.camunda.io' product-links.txt | sed "s!https://docs.camunda.io!http://${{ env.container_ip }}:8080!g" > product-links.prod.txt
- name: Waiting for URL available
uses: nev7n/wait_for_response@v1
with:
url: "http://${{ env.container_ip }}:8080/"
- name: Validate sitemap links
uses: lycheeverse/[email protected]
with:
args: "sitemap.prod.txt"
fail: true
- name: Validate product links
uses: lycheeverse/[email protected]
with:
args: "product-links.prod.txt"
fail: true
- name: Check internal links
uses: untitaker/[email protected]
with:
args: build/