-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (51 loc) · 1.5 KB
/
build-docs.yml
File metadata and controls
65 lines (51 loc) · 1.5 KB
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
name: Build Docs
on:
push:
branches: [main]
jobs:
build-docs:
runs-on: ubuntu-latest
concurrency:
group: flowquery-docs-${{ github.ref_name }}
cancel-in-progress: false
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install root dependencies
run: npm ci
- name: Install flowquery-app dependencies
working-directory: flowquery-app
run: npm ci
- name: Clean Vite output
run: rm -rf docs/assets docs/index.html
- name: Build docs app
working-directory: flowquery-app
run: npm run build
- name: Commit docs changes
env:
HUSKY: "0"
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add docs/
if git diff --staged --quiet; then
exit 0
fi
git commit -m "chore: rebuild docs [skip ci]"
for attempt in 1 2 3; do
git fetch origin main:refs/remotes/origin/main
if ! git rebase origin/main; then
git rebase --abort || true
elif git push origin HEAD:main; then
break
fi
if [ "$attempt" -eq 3 ]; then
echo "Failed to push docs rebuild after 3 attempts."
exit 1
fi
sleep 5
done