2
0
mirror of https://github.com/acepanel/acepanel.github.io.git synced 2026-02-04 06:47:16 +08:00
Files
acepanel.github.io/.github/workflows/deploy.yml
2026-01-25 04:39:37 +08:00

48 lines
1.1 KiB
YAML

name: Deploy site to Pages
on:
push:
branches: [ main ]
workflow_dispatch:
# 设置 GITHUB_TOKEN 的权限,以允许部署到 GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# 只允许同时进行一次部署
concurrency:
group: pages
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: latest
run_install: true
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: lts/*
cache: pnpm
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Build with VitePress
run: pnpm build
- name: Upload artifact
uses: actions/upload-pages-artifact@v4
with:
path: .vitepress/dist
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4