Skip to content

Commit

Permalink
feat(docs): gitpage
Browse files Browse the repository at this point in the history
  • Loading branch information
dogodo-cc committed May 27, 2024
1 parent 9878827 commit 221de6d
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/deploy-gitpage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: 发布到 GitPage

on:
push:
branches: ['master']
pull_request:
branches: ['master']

workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
if: contains(github.event.head_commit.message, 'docs')
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm

- name: 安装依赖
run: npm install

- name: 构建
run: npm run docs:build

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./projects/document/docs/.vitepress/dist

deploy:
needs: build

permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit 221de6d

Please sign in to comment.