Skip to content

🐎 ci: workflow test #5

🐎 ci: workflow test

🐎 ci: workflow test #5

Workflow file for this run

name: Build and Deploy
on:
push:
branches:
- master
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 16
# 使用 pnpm 作为包管理器
- name: Install pnpm
run: npm install -g pnpm
# 移除 node_modules
- name: Remove node_modules
run: rm -rf node_modules
- name: Install dependencies
run: pnpm i
- name: Build
run: pnpm run build
# 部署前清空旧的部署
- name: Cleanup old deployment
run: |
git worktree prune
rm -rf .git/worktrees/github-pages-deploy-action-temp-deployment-folder/
- name: Deploy
uses: JamesIves/github-pages-deploy-action@4.1.5
with:
branch: gh-pages
folder: dist