From 37bd4b918897db8cdf07d773b621a8ac1f771e28 Mon Sep 17 00:00:00 2001 From: Johan Euphrosine Date: Fri, 1 Nov 2024 14:08:00 -0700 Subject: [PATCH] github_workflows/docs: deploy from workflow See: https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#publishing-with-a-custom-github-actions-workflow Fixes: #1463 PiperOrigin-RevId: 692286430 --- .../workflows/build-mkdocs-commit-html.yml | 28 +++++++++++++------ 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-mkdocs-commit-html.yml b/.github/workflows/build-mkdocs-commit-html.yml index cfb1896dc6..26bf7791c3 100644 --- a/.github/workflows/build-mkdocs-commit-html.yml +++ b/.github/workflows/build-mkdocs-commit-html.yml @@ -7,11 +7,8 @@ on: # This lets us trigger manually from the UI. workflow_dispatch: -permissions: - contents: write - jobs: - docs: + build: runs-on: labels: ubuntu-22.04-4core steps: @@ -25,8 +22,21 @@ jobs: - name: Build MkDocs And Commit HTML run: | mkdocs build - git config --global user.name 'xls-github-bot' - git config --global user.email 'xls-github-bot' - git add . - LATEST_HASH=$(git rev-parse HEAD) - git commit -a -m "mkdocs generated documentation from ${LATEST_HASH}" && git push + - name: Upload static files as artifact + uses: actions/upload-pages-artifact@v3 + with: + path: docs/ + deploy: + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: + labels: ubuntu-22.04-4core + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file