Skip to content

Commit

Permalink
Update deployment workflow and package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
Leetfs committed Sep 7, 2024
1 parent bccdd51 commit 86d7fe7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
25 changes: 13 additions & 12 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy to Cloudflare Pages
name: 部署到 Cloudflare Pages

on:
push:
Expand All @@ -10,23 +10,24 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
- name: 检出代码库
uses: actions/checkout@v3

- name: Install pnpm
run: |
curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm
- name: 设置 Node.js
uses: actions/setup-node@v3
with:
node-version: '16' # 你可以根据需要选择 Node.js 的版本

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

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

- name: Install Wrangler
run: pnpm add -g wrangler
- name: 全局安装 Wrangler
run: npm install -g wrangler

- name: Publish to Cloudflare Pages
- name: 发布到 Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"build": "vite build"
},
"keywords": [],
"author": "",
Expand Down

0 comments on commit 86d7fe7

Please sign in to comment.