mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-14 06:43:25 +08:00
743c636441
This reverts commit 8df965bd606d4acd173e316f6992328ac2383516.
65 lines
1.4 KiB
YAML
65 lines
1.4 KiB
YAML
name: Deploy Vitepress docs to Pages
|
|
|
|
on:
|
|
# Runs on pushes targeting the default branch
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
|
|
# 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
|
|
|
|
- uses: pnpm/action-setup@v2
|
|
|
|
- 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@v3
|
|
|
|
- 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:
|
|
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
|
|
environment:
|
|
name: github-pages
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
steps:
|
|
- name: Deploy to GitHub Pages
|
|
id: deployment
|
|
uses: actions/deploy-pages@v1
|