From ae982cd6c78541fa51f520afa8846a8e572342b5 Mon Sep 17 00:00:00 2001 From: ciiiii Date: Fri, 14 Jun 2024 02:14:48 +0800 Subject: [PATCH] Deploy staging env --- .github/workflows/stage.yaml | 23 +++++++++++++++++++++++ wrangler.toml | 27 +++++++++++++++++++++------ 2 files changed, 44 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/stage.yaml diff --git a/.github/workflows/stage.yaml b/.github/workflows/stage.yaml new file mode 100644 index 0000000..2a68ce1 --- /dev/null +++ b/.github/workflows/stage.yaml @@ -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 \ No newline at end of file diff --git a/wrangler.toml b/wrangler.toml index 65f7b5a..db3b466 100644 --- a/wrangler.toml +++ b/wrangler.toml @@ -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" \ No newline at end of file +MODE = "debug" +TARGET_UPSTREAM = "https://registry-1.docker.io" \ No newline at end of file