forked from solana-labs/solana-program-library
-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (53 loc) · 1.41 KB
/
pull-request-docs.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
name: Docs Pull Request
on:
pull_request:
paths:
- 'docs/**'
push:
branches: [master]
paths:
- 'docs/**'
jobs:
all_github_action_checks:
runs-on: ubuntu-latest
if: needs.check_non_docs.outputs.run_all_github_action_checks == 'true'
needs:
- check_non_docs
- build_docs
steps:
- run: echo "Done"
check_non_docs:
outputs:
run_all_github_action_checks: ${{ steps.check_files.outputs.run_all_github_action_checks }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 2
- name: check modified files
id: check_files
run: |
echo "========== check paths of modified files =========="
echo "::set-output name=run_all_github_action_checks::true"
git diff --name-only HEAD^ HEAD > files.txt
while IFS= read -r file
do
if [[ $file != docs/** ]]; then
echo "Found modified non-'docs' file(s)"
echo "::set-output name=run_all_github_action_checks::false"
break
fi
done < files.txt
build_docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: "Build Docs"
run: |
cd docs/
npm ci
./build.sh