Skip to content

Commit

Permalink
Update deploy-vitepress-pnpm.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
postmodernistx authored Dec 28, 2024
1 parent 4bd743b commit 551f299
Showing 1 changed file with 49 additions and 25 deletions.
74 changes: 49 additions & 25 deletions deploy-vitepress-pnpm.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,64 @@
# Put in .github/workflows
name: deploy changes
# Sample workflow for building and deploying a VitePress site to GitHub Pages
name: Deploy VitePress site to Pages

on:
# Runs on pushes targeting the `main` branch. Change this to `master` if you're
# using the `master` branch as the default branch.
push:
branches:
- main
branches: [main]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: pages
cancel-in-progress: false

jobs:
deploy:
# Build job
build:
runs-on: ubuntu-latest
permissions: write-all
strategy:
matrix:
node-version: [16]
steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v2.2.4
- uses: pnpm/action-setup@v4
with:
version: 7

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
version: latest
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
node-version: latest
cache: pnpm

- name: Setup Pages
uses: actions/configure-pages@v4
- name: Install dependencies
run: pnpm install --no-frozen-lockfile

- name: Build
run: pnpm install
- name: Build with VitePress
run: pnpm docs:build

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/.vitepress/dist
path: docs/.vitepress/dist

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit 551f299

Please sign in to comment.