-
Notifications
You must be signed in to change notification settings - Fork 4
51 lines (42 loc) · 1.18 KB
/
doc-bot.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
name: Documentation Bot
on:
push:
branches:
- master
permissions:
contents: write
jobs:
generate-documentation:
runs-on: ubuntu-22.04
env:
CI_COMMIT_MESSAGE: Generated docs for ${{ github.sha }}
GH_TOKEN: ${{ secrets.GH_ACTION_ACCESS_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: documentation
fetch-depth: 0
token: ${{ secrets.GH_ACTION_ACCESS_TOKEN }}
- name: Configure git
run: |
git config user.name github-actions
git config user.email [email protected]
git fetch origin master
- name: Merge latest from master
run: |
git merge origin/master --commit --no-edit --strategy-option theirs
- name: Setup
uses: ./.github/actions/setup
- name: Generate docs
run: |
yarn generate-docs
- name: Commit and push docs
run: |
if [ $(git status -s -uno | wc -l) -eq 0 ]; then
echo "No documentation to change"
exit 0
fi
git add docs
git commit -m "${{ env.CI_COMMIT_MESSAGE }}"
git push