-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy_bak.yml
More file actions
36 lines (27 loc) · 1 KB
/
Copy pathdeploy_bak.yml
File metadata and controls
36 lines (27 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Deploy Nuxt3 App to GitHub Pages by branch
on:
push:
branches:
- main # 根据实际的主分支名称修改
permissions:
contents: write # 给予权限
jobs:
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" # 使用适合的 Node.js 版本
- name: Enable pnpm
run: corepack enable # 启用 pnpm 或 yarn
- name: Install Dependencies
run: pnpm install # 或 yarn install,根据你的偏好选择
- name: Generate Static Site
run: pnpm generate # 生成静态站点的命令
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4 # 这个 action 能将你的构建产物,作为新增内容提交到 gh-pages 分支
with:
folder: .output/public # 修改为 Nuxt.js 生成的静态文件夹名称