diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 45847c44..3e98992e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -19,6 +19,11 @@ jobs: node-version: 18 cache: yarn + - name: Setup Pages + uses: actions/configure-pages@v5 + with: + static_site_generator: sveltekit + - name: Build & Deploy env: MERMAID_DOMAIN: 'mermaid.live' @@ -33,12 +38,24 @@ jobs: version=$(yarn version --patch --no-git-tag-version | grep "New version" | cut -d':' -f 2) yarn build yarn run lint - cd .. - - name: Deploy - uses: peaceiris/actions-gh-pages@v3 - if: ${{ github.ref == 'refs/heads/master' }} + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./docs - keep_files: true + path: ./docs + + deploy: + if: ${{ github.ref == 'refs/heads/master' }} + needs: build + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + # 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 + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4