chore: Update deployment configuration for custom domain (#66)
Some checks failed
Deploy to Cloudflare Workers / Build & Deploy (push) Has been cancelled

This commit is contained in:
shxyke
2024-10-08 11:31:11 +08:00
committed by GitHub
parent 24d7c9fc90
commit 703fae4e63
4 changed files with 20 additions and 9 deletions

View File

@@ -16,8 +16,12 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Publish - name: Publish
uses: cloudflare/wrangler-action@v3 uses: cloudflare/wrangler-action@v3
env:
CUSTOM_DOMAIN: ${{ secrets.CUSTOM_DOMAIN || 'libcuda.so' }}
with: with:
apiToken: ${{ secrets.CF_API_TOKEN }} apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{secrets.CF_ACCOUNT_ID}} accountId: ${{secrets.CF_ACCOUNT_ID}}
vars:
CUSTOM_DOMAIN
command: deploy --env production --minify src/index.js command: deploy --env production --minify src/index.js
environment: production environment: production

View File

@@ -14,8 +14,12 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Publish - name: Publish
uses: cloudflare/wrangler-action@v3 uses: cloudflare/wrangler-action@v3
env:
CUSTOM_DOMAIN: ${{ secrets.CUSTOM_DOMAIN || 'libcuda.so' }}
with: with:
apiToken: ${{ secrets.CF_API_TOKEN }} apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{secrets.CF_ACCOUNT_ID}} accountId: ${{secrets.CF_ACCOUNT_ID}}
vars:
CUSTOM_DOMAIN
command: deploy --env staging --minify src/index.js command: deploy --env staging --minify src/index.js
environment: staging environment: staging

View File

@@ -7,17 +7,17 @@ const dockerHub = "https://registry-1.docker.io";
const routes = { const routes = {
// production // production
"docker.libcuda.so": dockerHub, ["docker." + CUSTOM_DOMAIN]: dockerHub,
"quay.libcuda.so": "https://quay.io", ["quay." + CUSTOM_DOMAIN]: "https://quay.io",
"gcr.libcuda.so": "https://gcr.io", ["gcr." + CUSTOM_DOMAIN]: "https://gcr.io",
"k8s-gcr.libcuda.so": "https://k8s.gcr.io", ["k8s-gcr." + CUSTOM_DOMAIN]: "https://k8s.gcr.io",
"k8s.libcuda.so": "https://registry.k8s.io", ["k8s." + CUSTOM_DOMAIN]: "https://registry.k8s.io",
"ghcr.libcuda.so": "https://ghcr.io", ["ghcr." + CUSTOM_DOMAIN]: "https://ghcr.io",
"cloudsmith.libcuda.so": "https://docker.cloudsmith.io", ["cloudsmith." + CUSTOM_DOMAIN]: "https://docker.cloudsmith.io",
"ecr.libcuda.so": "https://public.ecr.aws", ["ecr." + CUSTOM_DOMAIN]: "https://public.ecr.aws",
// staging // staging
"docker-staging.libcuda.so": dockerHub, ["docker-staging." + CUSTOM_DOMAIN]: dockerHub,
}; };
function routeByHosts(host) { function routeByHosts(host) {

View File

@@ -6,6 +6,9 @@ ip = "0.0.0.0"
port = 8787 port = 8787
local_protocol = "http" local_protocol = "http"
[env.vars]
CUSTOM_DOMAIN = "libcuda.so"
[env.dev.vars] [env.dev.vars]
MODE = "debug" MODE = "debug"
TARGET_UPSTREAM = "https://registry-1.docker.io" TARGET_UPSTREAM = "https://registry-1.docker.io"