mirror of
https://github.com/ciiiii/cloudflare-docker-proxy.git
synced 2026-04-20 21:59:04 +08:00
Compare commits
1 Commits
yscai/ci-f
...
yscai/dock
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c737c70c48 |
14
.github/workflows/deploy.yaml
vendored
14
.github/workflows/deploy.yaml
vendored
@@ -13,11 +13,15 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: Build & Deploy
|
name: Build & Deploy
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v2
|
||||||
|
- name: Use Node.js
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: "12.x"
|
||||||
|
- run: npm install
|
||||||
- name: Publish
|
- name: Publish
|
||||||
uses: cloudflare/wrangler-action@v3
|
uses: cloudflare/wrangler-action@2.0.0
|
||||||
with:
|
with:
|
||||||
apiToken: ${{ secrets.CF_API_TOKEN }}
|
apiToken: ${{ secrets.CF_API_TOKEN }}
|
||||||
accountId: ${{secrets.CF_ACCOUNT_ID}}
|
env:
|
||||||
command: deploy --env production --minify src/index.js
|
CF_ACCOUNT_ID: ${{secrets.CF_ACCOUNT_ID}}
|
||||||
environment: production
|
|
||||||
21
.github/workflows/stage.yaml
vendored
21
.github/workflows/stage.yaml
vendored
@@ -1,21 +0,0 @@
|
|||||||
name: Deploy to Cloudflare Workers(Staging)
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request_target:
|
|
||||||
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.js
|
|
||||||
environment: staging
|
|
||||||
@@ -6,7 +6,6 @@ addEventListener("fetch", (event) => {
|
|||||||
const dockerHub = "https://registry-1.docker.io";
|
const dockerHub = "https://registry-1.docker.io";
|
||||||
|
|
||||||
const routes = {
|
const routes = {
|
||||||
// production
|
|
||||||
"docker.libcuda.so": dockerHub,
|
"docker.libcuda.so": dockerHub,
|
||||||
"quay.libcuda.so": "https://quay.io",
|
"quay.libcuda.so": "https://quay.io",
|
||||||
"gcr.libcuda.so": "https://gcr.io",
|
"gcr.libcuda.so": "https://gcr.io",
|
||||||
@@ -14,9 +13,6 @@ const routes = {
|
|||||||
"k8s.libcuda.so": "https://registry.k8s.io",
|
"k8s.libcuda.so": "https://registry.k8s.io",
|
||||||
"ghcr.libcuda.so": "https://ghcr.io",
|
"ghcr.libcuda.so": "https://ghcr.io",
|
||||||
"cloudsmith.libcuda.so": "https://docker.cloudsmith.io",
|
"cloudsmith.libcuda.so": "https://docker.cloudsmith.io",
|
||||||
|
|
||||||
// staging
|
|
||||||
"docker-staging.libcuda.so": dockerHub,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
function routeByHosts(host) {
|
function routeByHosts(host) {
|
||||||
|
|||||||
@@ -1,35 +1,18 @@
|
|||||||
name = "cloudflare-docker-proxy"
|
name = "cloudflare-docker-proxy"
|
||||||
compatibility_date = "2023-12-01"
|
workers_dev = true
|
||||||
|
main = "src/index.js"
|
||||||
|
compatibility_date = "2021-12-07"
|
||||||
|
|
||||||
[dev]
|
[dev]
|
||||||
ip = "0.0.0.0"
|
ip = "0.0.0.0"
|
||||||
port = 8787
|
port = 8787
|
||||||
local_protocol = "http"
|
local_protocol="http"
|
||||||
|
upstream_protocol="https"
|
||||||
|
|
||||||
|
[vars]
|
||||||
|
MODE="production"
|
||||||
|
TARGET_UPSTREAM=""
|
||||||
|
|
||||||
[env.dev.vars]
|
[env.dev.vars]
|
||||||
MODE = "debug"
|
MODE="debug"
|
||||||
TARGET_UPSTREAM = "https://registry-1.docker.io"
|
TARGET_UPSTREAM="https://registry-1.docker.io"
|
||||||
|
|
||||||
[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.production.vars]
|
|
||||||
MODE = "production"
|
|
||||||
TARGET_UPSTREAM = ""
|
|
||||||
|
|
||||||
[env.staging]
|
|
||||||
name = "cloudflare-docker-proxy-staging"
|
|
||||||
route = { pattern = "docker-staging.libcuda.so", custom_domain = true }
|
|
||||||
|
|
||||||
[env.staging.vars]
|
|
||||||
MODE = "staging"
|
|
||||||
TARGET_UPSTREAM = ""
|
|
||||||
Reference in New Issue
Block a user