Skip to content

Commit

Permalink
add staging env
Browse files Browse the repository at this point in the history
  • Loading branch information
jshawl committed Mar 21, 2024
1 parent b0a85cb commit 73b0421
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,11 @@ jobs:
deploy:
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/main'
environment: production
environment: {{ github.ref == 'refs/heads/main' && 'production' || 'staging' }}
steps:
- uses: actions/checkout@v4
- name: Deploy
run: npx wrangler deploy
run: {{ github.ref == 'refs/heads/main' && 'npx wrangler deploy' || ' npx wranger deploy -e staging' }}
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
5 changes: 5 additions & 0 deletions wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@ compatibility_date = "2024-03-04"
compatibility_flags = ["nodejs_compat"]
routes = [
{ pattern = "www.cinotify.cc/api/*", zone_id = "8b83258726802e1e77310bd3b08dfefa" }
]

[env.staging]
routes = [
{ pattern = "staging.cinotify.cc/api/*", zone_id = "8b83258726802e1e77310bd3b08dfefa" }
]

0 comments on commit 73b0421

Please sign in to comment.