mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-14 06:43:25 +08:00
60 lines
1.3 KiB
YAML
60 lines
1.3 KiB
YAML
|
name: Deploy Vitepress docs to Pages
|
||
|
|
||
|
on:
|
||
|
# Runs on pushes targeting the default branch
|
||
|
push:
|
||
|
branches:
|
||
|
- master
|
||
|
|
||
|
# 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 one concurrent deployment
|
||
|
concurrency:
|
||
|
group: 'pages'
|
||
|
cancel-in-progress: true
|
||
|
|
||
|
jobs:
|
||
|
# Build job
|
||
|
build:
|
||
|
runs-on: ubuntu-latest
|
||
|
steps:
|
||
|
- name: Checkout
|
||
|
uses: actions/checkout@v3
|
||
|
- name: Setup Node.js
|
||
|
uses: actions/setup-node@v3
|
||
|
with:
|
||
|
cache: pnpm
|
||
|
node-version: 18
|
||
|
|
||
|
- name: Install Packages
|
||
|
run: pnpm install --frozen-lockfile
|
||
|
|
||
|
- name: Setup Pages
|
||
|
uses: actions/configure-pages@v2
|
||
|
|
||
|
- name: Run Build
|
||
|
run: pnpm --filter mermaid run docs:build:vitepress
|
||
|
|
||
|
- name: Upload artifact
|
||
|
uses: actions/upload-pages-artifact@v1
|
||
|
with:
|
||
|
path: packages/mermaid/src/vitepress/.vitepress/dist
|
||
|
|
||
|
# Deployment job
|
||
|
deploy:
|
||
|
environment:
|
||
|
name: github-pages
|
||
|
runs-on: ubuntu-latest
|
||
|
needs: build
|
||
|
steps:
|
||
|
- name: Deploy to GitHub Pages
|
||
|
id: deployment
|
||
|
uses: actions/deploy-pages@v1
|