Skip to content

style(char5): 🌈 调整第五章排版 #34

style(char5): 🌈 调整第五章排版

style(char5): 🌈 调整第五章排版 #34

Workflow file for this run

name: Deploy to GitHub Pages
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
with:
node-version: 20
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Build project
run: pnpm run docs:build
- name: Clean up old deployments
run: |
git fetch origin gh-pages
git checkout gh-pages
if [ $(git rev-list --count gh-pages) -gt 3 ]; then
git reset --hard HEAD~3
git push origin gh-pages --force
fi
shell: bash
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/.vitepress/dist
publish_branch: gh-pages
commit_message: 'auto deploy'