Skip to content

Commit e0e36c3

Browse files
[Admin] Add workflow to run GenerateDocs (#2061)
1 parent 39d7c1d commit e0e36c3

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

.github/workflows/autogen-docs.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: autogen-docs
2+
run-name: Automatically run GenerateDocs
3+
on:
4+
schedule:
5+
- cron: '45 10 * * TUE'
6+
- cron: '45 10 * * THU'
7+
jobs:
8+
autogen-docs:
9+
runs-on: windows-latest
10+
permissions:
11+
contents: write
12+
defaults:
13+
run:
14+
shell: bash
15+
working-directory: ./generate-docs
16+
steps:
17+
- name: Check out repository
18+
uses: actions/checkout@v4
19+
- name: Make the script file executable
20+
run: |
21+
echo "Making script file executable"
22+
chmod +x ./GenerateDocs.sh
23+
- name: Set up node
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: '18'
27+
- name: Run GenerateDocs script
28+
run: |
29+
echo "Generating docs"
30+
./GenerateDocs.sh -b DT+
31+
- name: Undo chmod
32+
run: |
33+
echo "Undoing script file chmod"
34+
chmod -x ./GenerateDocs.sh
35+
- name: Add any changes
36+
run: |
37+
echo "Determining if there are any changes"
38+
git config user.name github-actions
39+
git config user.email [email protected]
40+
git checkout -b autogen-docs
41+
git add ../.
42+
- name: Run git status
43+
run: |
44+
{
45+
echo 'git_status<<EOF'
46+
git status
47+
echo EOF
48+
} >> "$GITHUB_OUTPUT"
49+
id: run_git_status
50+
- name: Commit and push changes if any
51+
if: ${{ !contains(steps.run_git_status.outputs.git_status, 'nothing to commit, working tree clean') }}
52+
run: |
53+
echo "Committing and pushing changes to autogen-docs branch"
54+
git commit -m "Automatically generated docs"
55+
git push --set-upstream origin autogen-docs
56+

0 commit comments

Comments
 (0)