File tree Expand file tree Collapse file tree 3 files changed +69
-9
lines changed
Expand file tree Collapse file tree 3 files changed +69
-9
lines changed Original file line number Diff line number Diff line change @@ -21,15 +21,12 @@ readonly MODULE_TITLE_LOCATION='<section class="module-info">'
2121readonly API_DOC_MARKER=' <!-- API-DOC-MARKER -->'
2222
2323function check_git() {
24- # TEST
25- return 0
26-
27- if [ ! -z " $( git status --porcelain) " ] ; then
24+ if [ ! -z " $( git status --porcelain) " ] ; then
2825 echo " ERROR: Repository is not clean."
2926 exit 1
3027 fi
3128
32- if [ $( git branch --show-current) = = ' main' ] ; then
29+ if [ $( git branch --show-current) ! = ' main' ] ; then
3330 echo " ERROR: Repository is not on the main branch."
3431 exit 2
3532 fi
Original file line number Diff line number Diff line change 5353 if : runner.os == 'Linux'
5454 shell : bash
5555 run : ./scripts/gen_docs.sh
56+
57+ docs :
58+ needs : [test]
59+ if : ${{ github.event_name == 'push' && github.repository_owner == 'edulinq' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) }}
60+
61+ permissions :
62+ contents : read
63+ pages : write
64+ id-token : write
65+
66+ environment :
67+ name : github-pages
68+ url : ${{ steps.deployment.outputs.page_url }}
69+
70+ strategy :
71+ matrix :
72+ python-version : ['3.11']
73+ os : ['ubuntu-24.04']
74+
75+ runs-on : ${{ matrix.os }}
76+
77+ steps :
78+ - name : Checkout
79+ uses : actions/checkout@v4
80+ with :
81+ fetch-depth : 0
82+ fetch-tags : true
83+
84+ - name : Set up Python ${{ matrix.python-version }}
85+ uses : actions/setup-python@v5
86+ with :
87+ python-version : ${{ matrix.python-version }}
88+
89+ - name : Cache Python Dependencies
90+ uses : actions/cache@v4
91+ with :
92+ path : ${{ env.pythonLocation }}
93+ key : ${{ runner.os }}-os:${{ matrix.os }}-python:${{ matrix.python-version }}-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-dev.txt') }}
94+
95+ - name : Install Dependencies
96+ shell : bash
97+ run : pip install -r requirements.txt -r requirements-dev.txt
98+
99+ - name : Setup Pages
100+ uses : actions/configure-pages@v5
101+
102+ - name : Build Site
103+ shell : bash
104+ run : |
105+ git checkout main
106+ ./.ci/build_site.sh
107+
108+ - name : Upload Artifact
109+ uses : actions/upload-pages-artifact@v3
110+ with :
111+ path : ' ._site'
112+
113+ - name : Deploy to GitHub Pages
114+ id : deployment
115+ uses : actions/deploy-pages@v4
Original file line number Diff line number Diff line change 44
55readonly THIS_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd | xargs realpath) "
66readonly ROOT_DIR=" ${THIS_DIR} /.."
7+ readonly FAVICON_PATH=" ${ROOT_DIR} /.ci/html/images/favicon.ico"
78
89function main() {
910 if [[ $# -gt 1 ]]; then
@@ -14,16 +15,18 @@ function main() {
1415 set -e
1516 trap exit SIGINT
1617
17- local outputDir =" ${ROOT_DIR} /html"
18+ local output_dir =" ${ROOT_DIR} /html"
1819 if [[ $# -gt 0 ]]; then
19- outputDir =$1
20+ output_dir =$1
2021 fi
2122
2223 cd " ${ROOT_DIR} "
2324
24- mkdir -p " ${outputDir} "
25+ mkdir -p " ${output_dir} "
26+
27+ pdoc --output-directory " ${output_dir} " --favicon " $( basename " ${FAVICON_PATH} " ) " ./pacai edq ! .* _test
28+ cp " ${FAVICON_PATH} " " ${output_dir} "
2529
26- pdoc --output-directory " ${outputDir} " ./pacai edq ! .* _test
2730 return $?
2831}
2932
You can’t perform that action at this time.
0 commit comments