📝 setup twoslash integration #122
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docs | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- docs/** | |
pull_request: | |
paths: | |
- docs/** | |
workflow_dispatch: | |
inputs: | |
deploy: | |
description: Deploy ? | |
required: true | |
default: false | |
type: boolean | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
docs: | |
name: Docs | |
runs-on: ubuntu-latest | |
environment: | |
name: Docs (GH Pages) | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Pages | |
uses: actions/configure-pages@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Install pnpm | |
id: pnpm-install | |
uses: pnpm/action-setup@v2 | |
with: | |
run_install: false | |
- name: Get pnpm store | |
id: pnpm-store | |
shell: bash | |
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- name: Setup pnpm cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.pnpm-store.outputs.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: ${{ runner.os }}-pnpm-store- | |
- name: Install dependencies | |
run: pnpm i --frozen-lockfile | |
- name: Build plugin (needed for Twoslash) | |
run: pnpm --filter pinia-plugin-persistedstate build | |
- name: Build docs | |
run: pnpm run docs:build | |
- name: Upload artifact | |
if: ${{ github.event_name == 'push' || inputs.deploy }} | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: docs/.vitepress/dist | |
- name: Deploy to GitHub Pages | |
if: ${{ github.event_name == 'push' || inputs.deploy }} | |
id: deployment | |
uses: actions/deploy-pages@v1 |