fix: 🐛 add build script #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Deploy | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [16] | |
steps: | |
- name: Checkout ️ | |
uses: actions/checkout@v3 | |
- name: Package Build | |
run: | | |
npm i | |
cd packages/@huyikai/vitepress-helper | |
npm i | |
npm run build | |
- name: Install and Build | |
run: | | |
npm i | |
npm run build | |
env: | |
NODE_OPTIONS: '--max_old_space_size=4096' | |
- name: Deploy to GitHub Pages | |
uses: crazy-max/ghaction-github-pages@v2 | |
# 环境变量 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
# 部署到 gh-pages 分支 | |
target_branch: gh-pages | |
# 部署目录为 vitepress 的默认输出目录 | |
build_dir: example/.vitepress/dist |