-
Notifications
You must be signed in to change notification settings - Fork 188
59 lines (57 loc) · 2.14 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
50
51
52
53
54
55
56
57
58
59
name: build-docs
on:
push:
branches:
- "**"
- "!main"
tags-ignore:
- "*"
pull_request:
jobs:
build-docs:
# For internal PRs, this will run on `push` events;
# for external/forked PRs, it will run on `pull_request` events.
# Ideally we'd have checked this condition when defining the triggers,
# but that's not supported by GitHub actions.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 16
- name: Install Dependencies
run: npm ci
- 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/