From 1282f57a9f77c6cc8f598e3ef62f9d52bc4b3988 Mon Sep 17 00:00:00 2001 From: Gjermund Garaba Date: Mon, 9 Sep 2024 10:51:43 +0200 Subject: [PATCH] Deploy docs to pages with native gh action --- .github/workflows/deploy-docs.yaml | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/deploy-docs.yaml b/.github/workflows/deploy-docs.yaml index 95a6c5d..6b9437c 100644 --- a/.github/workflows/deploy-docs.yaml +++ b/.github/workflows/deploy-docs.yaml @@ -11,11 +11,8 @@ on: # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on jobs: - deploy: - name: Deploy to GitHub Pages + build: runs-on: ubuntu-latest - permissions: - contents: write steps: - uses: actions/checkout@v4 with: @@ -30,12 +27,19 @@ jobs: run: cd docs && npm ci - name: Build website run: cd docs && npm run build + - name: Upload artifact for pages + uses: actions/upload-pages-artifact@v3 + with: + path: docs/build - # Popular action to deploy to GitHub Pages: - # Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus + deploy: + name: Deploy to GitHub Pages + runs-on: ubuntu-latest + needs: build + permissions: + pages: write # to deploy to Pages + id-token: write + steps: - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v4 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - # Build output to publish to the `gh-pages` branch: - publish_dir: ./docs/build \ No newline at end of file + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file