chore: Use official action to deploy to pages

This commit is contained in:
Sidharth Vinod
2025-03-15 19:25:47 -07:00
parent e9bc0c24de
commit 214f6d0862

View File

@@ -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