.github/workflows/deploy-preview.yml #9
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: Deploy PR previews | |
on: | |
pull_request: | |
types: | |
- opened | |
- reopened | |
- synchronize | |
workflow_dispatch: | |
workflow_run: | |
workflows: | |
- "GitHub Pages (Branch Invoked)" | |
types: | |
- requested | |
jobs: | |
deploy-preview: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm i | |
- name: Build page | |
run: pnpm docs:build --base /pr-preview/pr-${{ github.event.number }}/ | |
- name: Deploy Preview | |
uses: rossjrw/pr-preview-action@v1.4.3 | |
with: | |
token: ${{ secrets.GH_PERSONAL_TOKEN }} | |
source-dir: ./content/.vitepress/dist | |
preview-branch: deploy | |
umbrella-dir: pr-preview | |
action: auto |