Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add cf worker hello world project and enable deploy via GITHUB action #78

Merged
merged 19 commits into from
Dec 17, 2022
Prev Previous commit
Next Next commit
add action
  • Loading branch information
zizifn committed Dec 17, 2022
commit 3a5fee06c075d24f3986de3a5dbe1a07832cffd6
6 changes: 6 additions & 0 deletions .github/workflows/cf-worker-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ on:
- main
- test-cf
workflow_dispatch:
inputs:
environment:
description: 'Choose an environment to deploy to: <dev|staging|prod>'
required: true
default: 'dev'

jobs:
deploy:
Expand All @@ -17,4 +22,5 @@ jobs:
uses: cloudflare/wrangler-action@2.0.0
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
command: publish --env ${{ github.event.inputs.environment || 'prod' }}
workingDirectory: 'apps/cf-worker-vless'
3 changes: 3 additions & 0 deletions apps/cf-worker-vless/wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ routes = [{ pattern = "cf-vless.zizi.press", custom_domain = true }]

[env.dev.vars]
TEST_VAR = "TEST_VAR_DEV"

[env.prod.vars]
TEST_VAR = "TEST_VAR_PROD"