From 097fe6627aabb9f843176fc999f611e5dea8ee0f Mon Sep 17 00:00:00 2001 From: Eduard Marbach Date: Tue, 5 Nov 2024 12:33:06 +0100 Subject: [PATCH] ci: try publish pages with official action --- .github/workflows/documentation.yml | 44 ++++++++++++++++++----------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 1806b4a..b17d5a2 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -10,12 +10,9 @@ on: paths: - docs/** -permissions: - contents: write - jobs: - deploy: - name: Deploy Documentation + build: + name: Build runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -37,15 +34,30 @@ jobs: pnpm i pnpm build - # Popular action to deploy to GitHub Pages: - # Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus - - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 - if: github.event_name == 'push' # && github.ref == 'refs/heads/main' + - name: Upload static files as artifact + id: deployment + uses: actions/upload-pages-artifact@v3 # or specific "vX.X.X" version tag for this action with: - github_token: ${{ secrets.GITHUB_TOKEN }} - # Build output to publish to the `gh-pages` branch: - publish_dir: ./docs/build - # Assign commit authorship to the official GH-Actions bot - user_name: github-actions[bot] - user_email: github-actions[bot]@users.noreply.github.com + path: ./docs/build + + # Deploy job + deploy: + # Add a dependency to the build job + needs: build + + # Grant GITHUB_TOKEN the permissions required to make a Pages deployment + permissions: + pages: write # to deploy to Pages + id-token: write # to verify the deployment originates from an appropriate source + + # Deploy to the github-pages environment + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + # Specify runner + deployment step + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action