11name : Generate API reference via Doxygen and push to GitHub Pages
2- env :
3- # Specify the doc version to which the API reference belongs
4- doc_version : 3.6.0
2+
53on :
6- push :
7- branches :
8- # Remember to update the branch name when you create a new branch
9- - master
4+ workflow_dispatch :
5+ inputs :
6+ branch_name :
7+ description : ' Which git branch should I check out?'
8+ required : true
9+
10+ python_version :
11+ description : ' Python SDK version to use for documentation'
12+ required : true
13+
1014
1115jobs :
1216 build :
1317 runs-on : ubuntu-latest
18+ env :
19+ BRANCH_NAME : ${{ github.event.inputs.branch_name }}
20+ PYTHON_VERSION : ${{ github.event.inputs.python_version }}
1421
1522 steps :
1623 - name : Checkout code
1724 uses : actions/checkout@v4
1825 with :
26+ ref : ${{ github.event.inputs.branch_name }}
1927 fetch-depth : 0 # fetch all commits/branches for gitversion
20-
21- - name : Extract branch name
22- run : echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
2328
2429 - name : Install Doxygen
2530 run : |
2631 sudo apt-get update
2732 sudo apt-get install -y doxygen graphviz
2833
29- # Generate HTML files
30- - name : Generate Documentation
34+ # Generate Python API reference
35+ - name : Generate Documentation for Python
3136 run : |
32- echo "OUTPUT_DIRECTORY=$BRANCH_NAME" >> doxygen-config
33- doxygen doxygen-config
34-
37+ echo "PROJECT_NUMBER=${PYTHON_VERSION}" >> doxygen/python-config
38+ mkdir -p "${PYTHON_VERSION}"
39+ echo "OUTPUT_DIRECTORY=${PYTHON_VERSION}" >> doxygen/python-config
40+ doxygen doxygen/python-config
41+
3542 # Deploy the generated HTML files to the gh-pages branch
3643 - name : Deploy to gh-pages
3744 uses : JamesIves/github-pages-deploy-action@v4
3845 with :
39- folder : ${{ env.BRANCH_NAME }}/html
40- target-folder : ${{ env.BRANCH_NAME }}
41-
42- # - name: show gh-pages branch
43- # run: |
44- # git branch
45- # git checkout .
46- # git checkout gh-pages
47-
48- # # Compresses HTML files into a tar.gz file
49- # - name: compress api reference
50- # run: |
51- # tar -zcvf $BRANCH_NAME.tar.gz $BRANCH_NAME
52-
53- # - name: transfer api reference
54- # uses: appleboy/scp-action@master
55- # with:
56- # host: 20.163.77.63
57- # username: azureuser
58- # password: ${{ secrets.ENSITE_PASSWORD }}
59- # port: 404
60- # source: $BRANCH_NAME.tar.gz
61- # # Return error if the target doc version does not already exist
62- # target: /var/www/ent-docs/${{ env.doc_version }}/
63-
64- # - name: uncompress ap reference
65- # uses: appleboy/ssh-action@master
66- # with:
67- # host: 20.163.77.63
68- # username: azureuser
69- # password: ${{ secrets.ENSITE_PASSWORD }}
70- # port: 404
71- # script: |
72- # mkdir -p /var/www/ent-docs/${{ env.doc_version}}/api/python/
73- # tar -zxf /var/www/ent-docs/${{ env.doc_version}}/$BRANCH_NAME.tar.gz -C /var/www/ent-docs/${{ env.doc_version}}/api/python/
46+ folder : ${PYTHON_VERSION}/html
47+ target-folder : ${PYTHON_VERSION}
0 commit comments