Skip to content

Commit

Permalink
Create deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Shua-github authored Dec 29, 2024
1 parent c688513 commit e872571
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Deploy to GitHub Pages

on:
push:
branches:
- main # 监听 main 分支的推送事件

jobs:
deploy:
runs-on: ubuntu-latest

steps:
# 检出代码
- name: Checkout code
uses: actions/checkout@v3

# 设置 Node.js 环境
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20'

# 安装依赖
- name: Install dependencies
run: npm install

# 构建项目
- name: Build project
run: npm run build

# 部署到 GitHub Pages
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build

0 comments on commit e872571

Please sign in to comment.