Skip to content

Commit

Permalink
docs(ci): use pnpm to fix setup error in gh actions (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
henryhale committed Jul 6, 2023
1 parent c209124 commit 026a726
Showing 1 changed file with 42 additions and 19 deletions.
61 changes: 42 additions & 19 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,59 @@
name: Deploy
name: Deploy to GitHub Pages

on:
workflow_dispatch: {}
push:
branches:
- master

permissions:
contents: write
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-node@v3
with:
registry-url: https://registry.npmjs.org/
node-version: 16
cache: npm
- run: npm ci
- name: Build
run: npm run docs:build
- uses: actions/configure-pages@v2
- uses: actions/upload-pages-artifact@v1

- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
path: docs/.vitepress/dist
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

- name: Build
run: pnpm docs:build

- name: Deploy
id: deployment
uses: actions/deploy-pages@v1
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/.vitepress/dist

0 comments on commit 026a726

Please sign in to comment.