Skip to content

Commit 703fae4

Browse files
authored
chore: Update deployment configuration for custom domain (#66)
1 parent 24d7c9f commit 703fae4

File tree

4 files changed

+20
-9
lines changed

4 files changed

+20
-9
lines changed

.github/workflows/deploy.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,12 @@ jobs:
1616
- uses: actions/checkout@v4
1717
- name: Publish
1818
uses: cloudflare/wrangler-action@v3
19+
env:
20+
CUSTOM_DOMAIN: ${{ secrets.CUSTOM_DOMAIN || 'libcuda.so' }}
1921
with:
2022
apiToken: ${{ secrets.CF_API_TOKEN }}
2123
accountId: ${{secrets.CF_ACCOUNT_ID}}
24+
vars:
25+
CUSTOM_DOMAIN
2226
command: deploy --env production --minify src/index.js
2327
environment: production

.github/workflows/stage.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@ jobs:
1414
- uses: actions/checkout@v4
1515
- name: Publish
1616
uses: cloudflare/wrangler-action@v3
17+
env:
18+
CUSTOM_DOMAIN: ${{ secrets.CUSTOM_DOMAIN || 'libcuda.so' }}
1719
with:
1820
apiToken: ${{ secrets.CF_API_TOKEN }}
1921
accountId: ${{secrets.CF_ACCOUNT_ID}}
22+
vars:
23+
CUSTOM_DOMAIN
2024
command: deploy --env staging --minify src/index.js
2125
environment: staging

src/index.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ const dockerHub = "https://registry-1.docker.io";
77

88
const routes = {
99
// production
10-
"docker.libcuda.so": dockerHub,
11-
"quay.libcuda.so": "https://quay.io",
12-
"gcr.libcuda.so": "https://gcr.io",
13-
"k8s-gcr.libcuda.so": "https://k8s.gcr.io",
14-
"k8s.libcuda.so": "https://registry.k8s.io",
15-
"ghcr.libcuda.so": "https://ghcr.io",
16-
"cloudsmith.libcuda.so": "https://docker.cloudsmith.io",
17-
"ecr.libcuda.so": "https://public.ecr.aws",
10+
["docker." + CUSTOM_DOMAIN]: dockerHub,
11+
["quay." + CUSTOM_DOMAIN]: "https://quay.io",
12+
["gcr." + CUSTOM_DOMAIN]: "https://gcr.io",
13+
["k8s-gcr." + CUSTOM_DOMAIN]: "https://k8s.gcr.io",
14+
["k8s." + CUSTOM_DOMAIN]: "https://registry.k8s.io",
15+
["ghcr." + CUSTOM_DOMAIN]: "https://ghcr.io",
16+
["cloudsmith." + CUSTOM_DOMAIN]: "https://docker.cloudsmith.io",
17+
["ecr." + CUSTOM_DOMAIN]: "https://public.ecr.aws",
1818

1919
// staging
20-
"docker-staging.libcuda.so": dockerHub,
20+
["docker-staging." + CUSTOM_DOMAIN]: dockerHub,
2121
};
2222

2323
function routeByHosts(host) {

wrangler.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ ip = "0.0.0.0"
66
port = 8787
77
local_protocol = "http"
88

9+
[env.vars]
10+
CUSTOM_DOMAIN = "libcuda.so"
11+
912
[env.dev.vars]
1013
MODE = "debug"
1114
TARGET_UPSTREAM = "https://registry-1.docker.io"

0 commit comments

Comments
 (0)