diff --git a/.github/workflows/doxygen.yml b/.github/workflows/doxygen.yml index bf9edafb..9a195fc3 100644 --- a/.github/workflows/doxygen.yml +++ b/.github/workflows/doxygen.yml @@ -1,73 +1,47 @@ name: Generate API reference via Doxygen and push to GitHub Pages -env: - # Specify the doc version to which the API reference belongs - doc_version: 3.6.0 + on: - push: - branches: - # Remember to update the branch name when you create a new branch - - master + workflow_dispatch: + inputs: + branch_name: + description: 'Which git branch should I check out?' + required: true + + python_version: + description: 'Python SDK version to use for documentation' + required: true + jobs: build: runs-on: ubuntu-latest + env: + BRANCH_NAME: ${{ github.event.inputs.branch_name }} + PYTHON_VERSION: ${{ github.event.inputs.python_version }} steps: - name: Checkout code uses: actions/checkout@v4 with: + ref: ${{ github.event.inputs.branch_name }} fetch-depth: 0 # fetch all commits/branches for gitversion - - - name: Extract branch name - run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV - name: Install Doxygen run: | sudo apt-get update sudo apt-get install -y doxygen graphviz - # Generate HTML files - - name: Generate Documentation + # Generate Python API reference + - name: Generate Documentation for Python run: | - echo "OUTPUT_DIRECTORY=$BRANCH_NAME" >> doxygen-config - doxygen doxygen-config - + echo "PROJECT_NUMBER=${PYTHON_VERSION}" >> doxygen/python-config + mkdir -p "${PYTHON_VERSION}" + echo "OUTPUT_DIRECTORY=${PYTHON_VERSION}" >> doxygen/python-config + doxygen doxygen/python-config + # Deploy the generated HTML files to the gh-pages branch - name: Deploy to gh-pages uses: JamesIves/github-pages-deploy-action@v4 with: - folder: ${{ env.BRANCH_NAME }}/html - target-folder: ${{ env.BRANCH_NAME }} - - # - name: show gh-pages branch - # run: | - # git branch - # git checkout . - # git checkout gh-pages - - # # Compresses HTML files into a tar.gz file - # - name: compress api reference - # run: | - # tar -zcvf $BRANCH_NAME.tar.gz $BRANCH_NAME - - # - name: transfer api reference - # uses: appleboy/scp-action@master - # with: - # host: 20.163.77.63 - # username: azureuser - # password: ${{ secrets.ENSITE_PASSWORD }} - # port: 404 - # source: $BRANCH_NAME.tar.gz - # # Return error if the target doc version does not already exist - # target: /var/www/ent-docs/${{ env.doc_version }}/ - - # - name: uncompress ap reference - # uses: appleboy/ssh-action@master - # with: - # host: 20.163.77.63 - # username: azureuser - # password: ${{ secrets.ENSITE_PASSWORD }} - # port: 404 - # script: | - # mkdir -p /var/www/ent-docs/${{ env.doc_version}}/api/python/ - # tar -zxf /var/www/ent-docs/${{ env.doc_version}}/$BRANCH_NAME.tar.gz -C /var/www/ent-docs/${{ env.doc_version}}/api/python/ \ No newline at end of file + folder: ${PYTHON_VERSION}/html + target-folder: ${PYTHON_VERSION} \ No newline at end of file