Skip to content

Commit

Permalink
chore: Update deployment configuration for custom domain (ciiiii#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
aa889788 authored Oct 8, 2024
1 parent 24d7c9f commit 703fae4
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 9 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@ jobs:
- uses: actions/checkout@v4
- name: Publish
uses: cloudflare/wrangler-action@v3
env:
CUSTOM_DOMAIN: ${{ secrets.CUSTOM_DOMAIN || 'libcuda.so' }}
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{secrets.CF_ACCOUNT_ID}}
vars:
CUSTOM_DOMAIN
command: deploy --env production --minify src/index.js
environment: production
4 changes: 4 additions & 0 deletions .github/workflows/stage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@ jobs:
- uses: actions/checkout@v4
- name: Publish
uses: cloudflare/wrangler-action@v3
env:
CUSTOM_DOMAIN: ${{ secrets.CUSTOM_DOMAIN || 'libcuda.so' }}
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{secrets.CF_ACCOUNT_ID}}
vars:
CUSTOM_DOMAIN
command: deploy --env staging --minify src/index.js
environment: staging
18 changes: 9 additions & 9 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ const dockerHub = "https://registry-1.docker.io";

const routes = {
// production
"docker.libcuda.so": dockerHub,
"quay.libcuda.so": "https://quay.io",
"gcr.libcuda.so": "https://gcr.io",
"k8s-gcr.libcuda.so": "https://k8s.gcr.io",
"k8s.libcuda.so": "https://registry.k8s.io",
"ghcr.libcuda.so": "https://ghcr.io",
"cloudsmith.libcuda.so": "https://docker.cloudsmith.io",
"ecr.libcuda.so": "https://public.ecr.aws",
["docker." + CUSTOM_DOMAIN]: dockerHub,
["quay." + CUSTOM_DOMAIN]: "https://quay.io",
["gcr." + CUSTOM_DOMAIN]: "https://gcr.io",
["k8s-gcr." + CUSTOM_DOMAIN]: "https://k8s.gcr.io",
["k8s." + CUSTOM_DOMAIN]: "https://registry.k8s.io",
["ghcr." + CUSTOM_DOMAIN]: "https://ghcr.io",
["cloudsmith." + CUSTOM_DOMAIN]: "https://docker.cloudsmith.io",
["ecr." + CUSTOM_DOMAIN]: "https://public.ecr.aws",

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

function routeByHosts(host) {
Expand Down
3 changes: 3 additions & 0 deletions wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ ip = "0.0.0.0"
port = 8787
local_protocol = "http"

[env.vars]
CUSTOM_DOMAIN = "libcuda.so"

[env.dev.vars]
MODE = "debug"
TARGET_UPSTREAM = "https://registry-1.docker.io"
Expand Down

0 comments on commit 703fae4

Please sign in to comment.