Skip to content

Commit 8008391

Browse files
committed
refactor(deploy): simplify and correct deployment scripts
1 parent ca7fd8b commit 8008391

File tree

2 files changed

+10
-19
lines changed

2 files changed

+10
-19
lines changed

.github/workflows/deploy.yml

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,14 @@ jobs:
3737
- name: Build Wasm Assets
3838
run: npm run build:wasm-assets
3939

40-
- name: Build Next.js application
41-
run: npx @opennextjs/cloudflare build
42-
43-
- name: Deploy Next.js to Cloudflare Pages
44-
uses: cloudflare/wrangler-action@v3
45-
with:
46-
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
47-
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
48-
command: pages deploy .open-next --project-name=rgou-main --branch=main
40+
- name: Deploy Frontend
41+
run: npm run deploy:cf
42+
env:
43+
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
44+
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
4945

5046
- name: Deploy AI Worker to Cloudflare Workers
51-
uses: cloudflare/wrangler-action@v3
52-
with:
53-
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
54-
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
55-
workingDirectory: "worker"
56-
command: deploy --config worker/wrangler.toml
47+
run: npm run deploy:worker
48+
env:
49+
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
50+
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}

package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@
1515
"pretty": "prettier --write '**/*.*'",
1616
"build:cf": "next build",
1717
"deploy:cf": "npm run build:cf && wrangler deploy",
18-
"dev:worker": "cd worker && npm run dev",
19-
"build:worker": "cd worker && npm run build",
20-
"deploy:worker": "cd worker && npm run deploy",
21-
"setup:worker": "cd worker && npm install",
18+
"deploy:worker": "cd worker && wrangler deploy",
2219
"build:wasm": "cd worker/rust_ai_core && wasm-pack build --target web --out-name rgou_ai_worker",
2320
"build:wasm-assets": "npm run build:wasm && rm -rf src/lib/wasm && mv worker/rust_ai_core/pkg src/lib/wasm && mkdir -p public/wasm && cp src/lib/wasm/rgou_ai_worker_bg.wasm public/wasm/",
2421
"prebuild": "npm run build:wasm-assets",

0 commit comments

Comments
 (0)