2022-10-31 21:44:09 +05:30
|
|
|
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
|
2023-07-02 10:14:35 +05:30
|
|
|
build-docs:
|
2022-10-31 21:44:09 +05:30
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-11-09 12:56:57 +01:00
|
|
|
uses: actions/checkout@v4
|
2022-10-31 21:54:57 +05:30
|
|
|
|
2024-07-04 15:00:09 +08:00
|
|
|
- uses: pnpm/action-setup@v4
|
2022-10-31 21:54:57 +05:30
|
|
|
|
2022-10-31 21:44:09 +05:30
|
|
|
- name: Setup Node.js
|
2023-11-09 12:56:57 +01:00
|
|
|
uses: actions/setup-node@v4
|
2022-10-31 21:44:09 +05:30
|
|
|
with:
|
|
|
|
cache: pnpm
|
2024-01-30 20:44:39 +05:30
|
|
|
node-version-file: '.node-version'
|
2022-10-31 21:44:09 +05:30
|
|
|
|
|
|
|
- name: Install Packages
|
|
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
|
|
|
|
- name: Setup Pages
|
2024-03-25 13:46:41 +00:00
|
|
|
uses: actions/configure-pages@v4
|
2022-10-31 21:44:09 +05:30
|
|
|
|
|
|
|
- name: Run Build
|
|
|
|
run: pnpm --filter mermaid run docs:build:vitepress
|
|
|
|
|
|
|
|
- name: Upload artifact
|
2024-03-25 13:46:41 +00:00
|
|
|
uses: actions/upload-pages-artifact@v3
|
2022-10-31 21:44:09 +05:30
|
|
|
with:
|
|
|
|
path: packages/mermaid/src/vitepress/.vitepress/dist
|
|
|
|
|
|
|
|
# Deployment job
|
2023-07-02 10:14:35 +05:30
|
|
|
deploy-docs:
|
2022-10-31 21:44:09 +05:30
|
|
|
environment:
|
|
|
|
name: github-pages
|
|
|
|
runs-on: ubuntu-latest
|
2023-07-02 10:14:35 +05:30
|
|
|
needs: build-docs
|
2022-10-31 21:44:09 +05:30
|
|
|
steps:
|
|
|
|
- name: Deploy to GitHub Pages
|
|
|
|
id: deployment
|
2024-03-25 13:46:41 +00:00
|
|
|
uses: actions/deploy-pages@v4
|