Skip to content

Commit

Permalink
docs: setup CI
Browse files Browse the repository at this point in the history
  • Loading branch information
penpenpng committed Aug 31, 2024
1 parent c40ff7f commit 60fd298
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Simple workflow for deploying static content to GitHub Pages
name: deploy document

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
paths: "packages/docs/**"

# 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 only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
build:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
# Build
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ vars.NODE_VERSION }}
registry-url: https://registry.npmjs.org
- name: cache node_modules
id: node_modules_cache_id
uses: actions/cache@v2
with:
path: |
node_modules
key: node-v${{ vars.NODE_VERSION }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }}
- run: npm ci
- run: npm run docs:build

# Deploy
- uses: actions/configure-pages@v3
- uses: actions/upload-pages-artifact@v1
with:
path: "docs/.vitepress/dist"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2

0 comments on commit 60fd298

Please sign in to comment.