2023-06-23 06:33:04 +00:00
|
|
|
name: Deploy
|
|
|
|
on:
|
|
|
|
workflow_dispatch: {}
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
jobs:
|
|
|
|
deploy:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
# 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 }}
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2023-06-23 08:41:46 +00:00
|
|
|
|
|
|
|
# setup nodejs, pnpm and vitepress
|
2023-06-23 06:33:04 +00:00
|
|
|
- uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: 18
|
2023-06-23 08:41:46 +00:00
|
|
|
- uses: pnpm/action-setup@v2
|
|
|
|
name: Install pnpm
|
|
|
|
id: pnpm-install
|
|
|
|
with:
|
|
|
|
version: 7
|
|
|
|
run_install: false
|
|
|
|
- name: Get pnpm store directory
|
|
|
|
id: pnpm-cache
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
|
|
|
|
|
|
|
|
- uses: actions/cache@v3
|
|
|
|
name: Setup pnpm cache
|
|
|
|
with:
|
|
|
|
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
|
|
|
|
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-pnpm-store-
|
|
|
|
- name: Install dependencies
|
|
|
|
run: pnpm install
|
|
|
|
|
|
|
|
# build and deploy the docs
|
2023-06-23 06:33:04 +00:00
|
|
|
- name: Build
|
2023-06-23 08:43:37 +00:00
|
|
|
run: pnpm docs:build
|
2023-06-23 06:33:04 +00:00
|
|
|
- uses: actions/configure-pages@v2
|
|
|
|
- uses: actions/upload-pages-artifact@v1
|
|
|
|
with:
|
|
|
|
path: docs/.vitepress/dist
|
2023-06-23 08:55:45 +00:00
|
|
|
|
|
|
|
# use vercel currently, so disable this one
|
|
|
|
# - name: Deploy to GitHub Pages
|
|
|
|
# id: deployment
|
|
|
|
# uses: actions/deploy-pages@v2 # or the latest "vX.X.X" version tag for this action
|