Skip to content

Commit 92ccf83

Browse files
committed
docs:update astro.config.mjs
1 parent 21491ee commit 92ccf83

File tree

1 file changed

+24
-33
lines changed

1 file changed

+24
-33
lines changed

.github/workflows/deploy.yml

Lines changed: 24 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,35 @@
1-
name: Deploy to Pages Branch
2-
1+
name: Deploy to GitHub Pages
32
on:
4-
# 每次推送到 `main` 分支时触发这个"工作流程"
3+
# 每次推送到 `main` 分支时触发这个工作流程
54
# 如果你使用了别的分支名,请按需将 `main` 替换成你的分支名
65
push:
76
branches: [ main ]
8-
# 允许你在 GitHub 上的 Actions 标签中手动触发此"工作流程"
7+
# 允许你在 GitHub 上的 Actions 标签中手动触发此工作流程
98
workflow_dispatch:
10-
11-
# 需要写入权限来推送到pages分支
9+
# 允许 job 克隆 repo 并创建一个 page deployment
1210
permissions:
13-
contents: write
14-
11+
contents: read
12+
pages: write
13+
id-token: write
1514
jobs:
16-
build-and-deploy:
15+
build:
1716
runs-on: ubuntu-latest
1817
steps:
1918
- name: Checkout your repository using git
2019
uses: actions/checkout@v4
21-
22-
- name: Setup Node.js
23-
uses: actions/setup-node@v4
24-
with:
25-
node-version: '20'
26-
27-
- name: Setup pnpm
28-
uses: pnpm/action-setup@v4
29-
with:
30-
version: 9.14.4
31-
run_install: false
32-
33-
- name: Install dependencies
34-
run: pnpm install --no-frozen-lockfile
35-
36-
- name: Build site
37-
run: pnpm run build
38-
39-
- name: Deploy to pages branch
40-
uses: JamesIves/github-pages-deploy-action@v4
41-
with:
42-
branch: pages # 部署到pages分支
43-
folder: dist # Astro默认构建输出目录
44-
clean: true # 清理目标分支中的旧文件
20+
- name: Install, build, and upload your site
21+
uses: withastro/action@v3
22+
# with:
23+
# path: . # 存储库中 Astro 项目的根位置。(可选)
24+
# node-version: 20 # 用于构建站点的特定 Node.js 版本,默认为 20。(可选)
25+
# package-manager: pnpm@latest # 应使用哪个 Node.js 包管理器来安装依赖项和构建站点。会根据存储库中的 lockfile 自动检测。(可选)
26+
deploy:
27+
needs: build
28+
runs-on: ubuntu-latest
29+
environment:
30+
name: github-pages
31+
url: ${{ steps.deployment.outputs.page_url }}
32+
steps:
33+
- name: Deploy to GitHub Pages
34+
id: deployment
35+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)