Skip to content

Commit

Permalink
[Test] Deploy to Cloudflare Workers
Browse files Browse the repository at this point in the history
  • Loading branch information
gxres042 committed Oct 4, 2024
1 parent 497a976 commit b7ab94f
Show file tree
Hide file tree
Showing 4 changed files with 635 additions and 22 deletions.
19 changes: 12 additions & 7 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,16 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Install dependencies
run: pnpm install && pnpm add -g vercel@latest
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
run: pnpm install
- name: Build Nitro
run: pnpm build
env:
NITRO_PRESET: cloudflare
- name: Deploy to Cloudflare Workers
uses: cloudflare/wrangler-action@v3
with:
accountId: ${{ secrets.CF_ACCOUNT_ID }}
apiToken: ${{ secrets.CF_API_TOKEN }}
command: deploy
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"preview": "node .output/server/index.mjs"
},
"devDependencies": {
"nitropack": "latest"
"nitropack": "latest",
"wrangler": "^3.79.0"
},
"dependencies": {
"js-yaml": "^4.1.0"
Expand Down
Loading

0 comments on commit b7ab94f

Please sign in to comment.