forked from CuteLeaf/Firefly
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (38 loc) · 1.26 KB
/
deploy.yml
File metadata and controls
47 lines (38 loc) · 1.26 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
37
38
39
40
41
42
43
44
45
46
47
name: Deploy to Pages Branch
on:
# 每次推送到 `master` 分支时触发这个"工作流程"
# 如果你使用了别的分支名,请按需将 `master` 替换成你的分支名
push:
branches: [ master ]
# 允许你在 GitHub 上的 Actions 标签中手动触发此"工作流程"
workflow_dispatch:
# 需要写入权限来推送到pages分支
permissions:
contents: write
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout your repository using git
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.14.4
run_install: false
- name: Install dependencies
run: pnpm install --no-frozen-lockfile
- name: Build site
run: pnpm run build
- name: Create .nojekyll file
run: touch dist/.nojekyll
- name: Deploy to pages branch
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: pages # 部署到pages分支
folder: dist # Astro默认构建输出目录
clean: true # 清理目标分支中的旧文件