forked from solana-labs/solana-program-library
-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (55 loc) · 1.5 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
59
60
name: Docs Pull Request
on:
pull_request:
paths:
- 'docs/**'
- '.github/workflows/pull-request-docs.yml'
push:
branches: [master]
paths:
- 'docs/**'
- '.github/workflows/pull-request-docs.yml'
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 "run_all_github_action_checks=true" >> $GITHUB_OUTPUT
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 "run_all_github_action_checks=false" >> $GITHUB_OUTPUT
break
fi
done < files.txt
build_docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '18'
- name: "Build Docs"
run: |
cd docs/
npm ci
./build.sh