From 14da8783cf00da3be6ded997fa93868e72a20d0e Mon Sep 17 00:00:00 2001 From: Jim Garrison Date: Fri, 6 Sep 2024 11:02:18 -0400 Subject: [PATCH] Update docs workflow (#5) * Update docs workflow - Use actions/deploy-pages for deployment - Update artifact name and extraction directory Builds on #1 Co-authored-by: Max Rossmannek * Use upload-pages-artifact; don't extract to a subdirectory --------- Co-authored-by: Max Rossmannek (cherry picked from commit 4152fac956cdc7ed889da3b6387e1634f14e7dfa) --- .github/workflows/docs.yml | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 80c7c62..c2f0a06 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -14,7 +14,8 @@ on: - 'stable/**' jobs: - build_and_deploy_docs: + build: + name: Build docs runs-on: ubuntu-latest timeout-minutes: 20 steps: @@ -39,21 +40,25 @@ jobs: shell: bash run: | tox -edocs - - name: Prepare docs artifact - if: always() - shell: bash - run: | - mkdir artifact - cp -a docs/_build/html artifact/addon_utils_html_docs - name: Upload docs artifact if: always() - uses: actions/upload-artifact@v4 - with: - name: addon_utils_html_docs - path: ./artifact - - name: Deploy docs - if: ${{ github.ref == 'refs/heads/stable/0.1' }} - uses: peaceiris/actions-gh-pages@v4 + uses: actions/upload-pages-artifact@v3 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./docs/_build/html/ + name: qiskit-addon-utils-htmldocs + path: docs/_build/html + + deploy: + name: Deploy docs + if: ${{ github.ref == 'refs/heads/stable/0.1' }} + needs: build + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4