Skip to content

Commit

Permalink
feat: add github action to automatically deploy on main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
zhigang1992 committed Sep 7, 2024
1 parent 075372b commit 42a3686
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build and Deploy Docs

on:
push:
branches:
- main # or your default branch name

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 9

- name: Install dependencies
run: pnpm install

- name: Build docs
run: pnpm docs

- name: Setup Pages
uses: actions/configure-pages@v4

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './docs'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit 42a3686

Please sign in to comment.