ci: 添加并更新GitHub Actions部署配置

删除旧的部署配置文件并添加新的配置,使用固定CNAME替换环境变量
This commit is contained in:
二叉树树
2026-01-21 23:37:42 +08:00
parent cd8b51fa52
commit d05a597777

44
.github/workflows/deploy.yml vendored Normal file
View File

@@ -0,0 +1,44 @@
name: 构建并发布到page分支
on:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-deploy:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 9
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20
cache: 'pnpm'
- name: Install Dependencies
run: pnpm install
- name: Build
run: pnpm run build
- name: Deploy to page branch
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
publish_branch: page
cname: blog.acofork.com
commit_message: ${{ github.event.head_commit.message }}