mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-14 06:43:25 +08:00
60 lines
1.5 KiB
YAML
60 lines
1.5 KiB
YAML
name: Deploy Vitepress docs to Pages
|
|
|
|
on:
|
|
# Runs on pushes targeting the default branch
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
# 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-docs:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
|
|
|
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
|
|
with:
|
|
cache: pnpm
|
|
node-version-file: '.node-version'
|
|
|
|
- name: Install Packages
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Setup Pages
|
|
uses: actions/configure-pages@1f0c5cde4bc74cd7e1254d0cb4de8d49e9068c7d # v4.0.0
|
|
|
|
- name: Run Build
|
|
run: pnpm --filter mermaid run docs:build:vitepress
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
|
|
with:
|
|
path: packages/mermaid/src/vitepress/.vitepress/dist
|
|
|
|
# Deployment job
|
|
deploy-docs:
|
|
environment:
|
|
name: github-pages
|
|
runs-on: ubuntu-latest
|
|
needs: build-docs
|
|
steps:
|
|
- name: Deploy to GitHub Pages
|
|
id: deployment
|
|
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5
|