Skip to content

Commit 23d7fa5

Browse files
authored
chore: auto deploy to cf workers (#1068)
1 parent 83f8714 commit 23d7fa5

File tree

1 file changed

+43
-1
lines changed

1 file changed

+43
-1
lines changed

.github/workflows/deploy.yml

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
with:
5555
path: apps/web/dist
5656

57-
deploy:
57+
deploy-pages:
5858
needs: build
5959
permissions:
6060
pages: write
@@ -67,3 +67,45 @@ jobs:
6767
- name: Deploy to GitHub Pages
6868
id: deployment
6969
uses: actions/deploy-pages@v4
70+
71+
deploy-cloudflare:
72+
needs: build
73+
runs-on: ubuntu-latest
74+
if: github.repository == 'doocs/md'
75+
steps:
76+
- name: Checkout
77+
uses: actions/checkout@v5
78+
79+
- name: Set up node
80+
uses: actions/setup-node@v6
81+
with:
82+
node-version: 22
83+
84+
- name: Setup pnpm
85+
uses: pnpm/action-setup@v4
86+
with:
87+
version: 10
88+
89+
- name: Install dependencies
90+
run: pnpm install
91+
92+
- name: Build for Cloudflare Workers
93+
run: pnpm web build:h5-netlify
94+
env:
95+
CF_PAGES: 1
96+
97+
- name: Deploy to Cloudflare Workers
98+
uses: cloudflare/wrangler-action@v3
99+
with:
100+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
101+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
102+
command: deploy --name md
103+
workingDirectory: apps/web
104+
env:
105+
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
106+
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
107+
108+
- name: Deployment Summary
109+
run: |
110+
echo "🚀 Deployed to Cloudflare Workers!"
111+
echo "📍 URL: https://md.doocs.workers.dev"

0 commit comments

Comments
 (0)