Skip to content

Commit 1269926

Browse files
authored
Create main.yml
1 parent a0e83e1 commit 1269926

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/main.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Build Documentation Index
2+
3+
on:
4+
push:
5+
paths:
6+
- 'docs/**'
7+
branches:
8+
- main
9+
repository_dispatch:
10+
types: [build_docs]
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: write
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v3
22+
with:
23+
node-version: '18'
24+
25+
- name: Build docs
26+
run: node build-docs.js
27+
28+
- name: Check for changes
29+
id: check_changes
30+
run: |
31+
git diff --quiet index.json || echo "changes=true" >> $GITHUB_OUTPUT
32+
33+
- name: Commit and push if changed
34+
if: steps.check_changes.outputs.changes == 'true'
35+
run: |
36+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
37+
git config --local user.name "github-actions[bot]"
38+
git add index.json
39+
git commit -m "Update documentation index"
40+
git push

0 commit comments

Comments
 (0)