actions: Create Github Pages Deploy Workflow Again

This commit is contained in:
ruabbit
2024-12-06 10:35:22 +08:00
committed by GitHub
parent 47759ce098
commit 434f67b2b5
+64
View File
@@ -0,0 +1,64 @@
name: Deploy VitePress Site
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
env:
TZ: Asia/Shanghai
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: latest
run_install: false
- name: Install dependencies
run: pnpm install
- name: Build VitePress site
run: pnpm docs:build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: .vitepress/dist
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4