mermaid/.github/workflows/publish-docs.yml

60 lines
1.3 KiB
YAML
Raw Normal View History

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
uses: actions/checkout@v4
2022-10-31 21:54:57 +05:30
- 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
uses: actions/setup-node@v4
2022-10-31 21:44:09 +05:30
with:
cache: pnpm
node-version-file: '.node-version'
2022-10-31 21:44:09 +05:30
- name: Install Packages
run: pnpm install --frozen-lockfile
- name: Setup Pages
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
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
uses: actions/deploy-pages@v4