Deploy staging env

This commit is contained in:
ciiiii
2024-06-14 02:14:48 +08:00
parent 7fbc589095
commit ae982cd6c7
2 changed files with 44 additions and 6 deletions

23
.github/workflows/stage.yaml vendored Normal file
View File

@@ -0,0 +1,23 @@
name: Deploy to Cloudflare Workers(Staging)
on:
pull_request:
branches:
- master
paths-ignore:
- '**.md'
repository_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
name: Build & Deploy
steps:
- uses: actions/checkout@v4
- name: Publish
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{secrets.CF_ACCOUNT_ID}}
command: deploy --env staging --minify src/index.ts
environment: staging

View File

@@ -6,13 +6,28 @@ compatibility_date = "2021-12-07"
[dev]
ip = "0.0.0.0"
port = 8787
local_protocol="http"
upstream_protocol="https"
local_protocol = "http"
[vars]
MODE="production"
TARGET_UPSTREAM=""
MODE = "production"
TARGET_UPSTREAM = ""
[env.production]
name = "cloudflare-docker-proxy"
routes = [
{ pattern = "docker.libcuda.so", custom_domain = true },
{ pattern = "quey.libcuda.so", custom_domain = true },
{ pattern = "gcr.libcuda.so", custom_domain = true },
{ pattern = "k8s-gcr.libcuda.so", custom_domain = true },
{ pattern = "k8s.libcuda.so", custom_domain = true },
{ pattern = "ghcr.libcuda.so", custom_domain = true },
{ pattern = "cloudsmith.libcuda.so", custom_domain = true },
]
[env.staging]
name = "cloudflare-docker-proxy-staging"
route = { pattern = "docker-staging.libcuda.so", custom_domain = true }
[env.dev.vars]
MODE="debug"
TARGET_UPSTREAM="https://registry-1.docker.io"
MODE = "debug"
TARGET_UPSTREAM = "https://registry-1.docker.io"