diff --git a/.github/workflows/build-doc.yml b/.github/workflows/build-doc.yml index b567d003..0b217295 100644 --- a/.github/workflows/build-doc.yml +++ b/.github/workflows/build-doc.yml @@ -4,6 +4,20 @@ on: push: branches: - main + pull_request: + + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false jobs: test_linux: @@ -24,12 +38,20 @@ jobs: run: | python -m pip install -r docs/requirements.txt - - name: Deploying on GitHub Pages + - name: Bulid Documentation env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} if: github.ref == 'refs/heads/main' run: | - git config --global user.name 'Git bot' - git config --global user.email 'bot@noreply.github.com' - git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git - ./scripts/gh_deploy_doc.sh + cd docs + make html + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + # Upload entire repository + path: 'docs/_build/html' + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4