Skip to content

Commit 900c07d

Browse files
committed
setup external ci/cd
1 parent d1a1bf0 commit 900c07d

File tree

4 files changed

+2047
-601
lines changed

4 files changed

+2047
-601
lines changed

.github/workflows/deploy.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# authenticate to CF
2+
# install application
3+
# deploy (if not main, use preview alias and branch; otherwise, deploy, custom domain)
4+
5+
name: deploy
6+
7+
on:
8+
workflow_dispatch:
9+
push:
10+
jobs:
11+
deploy:
12+
runs-on: ubuntu-latest
13+
env:
14+
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
15+
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
16+
steps:
17+
- uses: actions/checkout@v5
18+
- uses: actions/setup-node@v6
19+
with:
20+
node-version: 22
21+
- run: npm ci
22+
- run: npx wrangler whoami
23+
- run: npm run build
24+
- name: Deploy --preview-alias
25+
if: "${{ github.ref_name == 'main' }}"
26+
run: wrangler versions upload --preview-alias $(git rev-parse --abbrev-ref HEAD)
27+
- name: Deploy production
28+
if: "${{ github.ref_name == 'main' }}"
29+
env:
30+
IS_PREVIEW_ENV: true
31+
run: npx wrangler deploy

0 commit comments

Comments
 (0)