File tree Expand file tree Collapse file tree 2 files changed +54
-1
lines changed Expand file tree Collapse file tree 2 files changed +54
-1
lines changed Original file line number Diff line number Diff line change 1+ name : Generate Documentation
2+
3+ on :
4+ pull_request :
5+ branches : [ main ]
6+ repository_dispatch :
7+ types : [ generate ]
8+ workflow_dispatch :
9+ schedule :
10+ - cron : ' 15 5 * * *'
11+
12+ permissions :
13+ contents : read
14+
15+ jobs :
16+ build :
17+ # Only run scheduled workflows on the main repository; prevents people
18+ # from using build minutes on their forks.
19+ if : github.repository == 'libgit2/www.libgit2.org-docs'
20+ name : " Generate documentation"
21+ runs-on : " ubuntu-latest"
22+ steps :
23+ - name : Check out repository
24+ uses : actions/checkout@v4
25+ with :
26+ path : docs
27+ fetch-depth : 0
28+ ssh-key : ${{ secrets.DOCS_PUBLISH_KEY }}
29+ - name : Generate documentation
30+ run : |
31+ npm install
32+ ./generate ..
33+ working-directory : docs/_generator
34+ - name : Examine changes
35+ run : |
36+ if [ -n "$(git diff --name-only)" ]; then
37+ echo "changes=true" >> $GITHUB_OUTPUT
38+ else
39+ echo "changes=false" >> $GITHUB_OUTPUT
40+ fi
41+ id : check
42+ working-directory : docs
43+ - name : Publish documentation
44+ run : |
45+ DATE=$(date +"%Y-%m-%d")
46+
47+ git config user.name 'Documentation Site Generator'
48+ git config user.email 'libgit2@users.noreply.github.com'
49+ git add .
50+ git commit -m"Documentation update ${DATE}"
51+ git push origin main
52+ if : steps.check.outputs.changes == 'true'
53+ working-directory : docs
Original file line number Diff line number Diff line change 1- #! /bin/sh
1+ #! /usr/ bin/env bash
22
33set -eo pipefail
44
You can’t perform that action at this time.
0 commit comments