This repository was archived by the owner on Mar 18, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,20 +2,42 @@ name: Deploy to Cloudflare
22
33on :
44 push :
5- branches : [main]
5+ branches :
6+ - main
7+ - staging
8+ pull_request :
9+ branches :
10+ - staging
611
712jobs :
813 deploy :
914 runs-on : ubuntu-latest
10- name : Ship Ship Ship
15+ name : Deploy and Test
1116 steps :
1217 - name : Checkout Code
1318 uses : actions/checkout@v4
19+
20+ - name : Determine Environment
21+ id : env
22+ run : |
23+ if [[ ${{ github.event_name }} == 'pull_request' ]]; then
24+ echo "WRANGLER_ENV=preview" >> $GITHUB_ENV
25+ echo "TEST_URL=https://aibtcdev-cache.PREVIEW_URL" >> $GITHUB_ENV
26+ elif [[ ${{ github.ref }} == 'refs/heads/staging' ]]; then
27+ echo "WRANGLER_ENV=staging" >> $GITHUB_ENV
28+ echo "TEST_URL=https://cache-staging.aibtc.dev" >> $GITHUB_ENV
29+ else
30+ echo "WRANGLER_ENV=production" >> $GITHUB_ENV
31+ echo "TEST_URL=https://cache.aibtc.dev" >> $GITHUB_ENV
32+ fi
33+
1434 - name : Deploy with Wrangler
1535 uses : cloudflare/wrangler-action@v3
1636 with :
1737 apiToken : ${{ secrets.CLOUDFLARE_API_TOKEN }}
38+ environment : ${{ env.WRANGLER_ENV }}
39+
1840 - name : Test Endpoints (10s delay)
1941 run : |
2042 chmod +x tests/run_tests.sh
21- ./tests/run_tests.sh https://cache.aibtc.dev true
43+ ./tests/run_tests.sh ${{ env.TEST_URL }} true
You can’t perform that action at this time.
0 commit comments