Skip to content

Commit a2e091d

Browse files
committed
pass different api url for build and runtime
1 parent ba16b84 commit a2e091d

File tree

3 files changed

+2
-10
lines changed

3 files changed

+2
-10
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ jobs:
4747
build-args: |
4848
NEXT_PUBLIC_URI=${{ vars.NEXT_PUBLIC_URI }}
4949
INTERNAL_JWT_SECRET=${{ secrets.INTERNAL_JWT_SECRET }}
50-
URI_GITRANKS=${{ vars.URI_GITRANKS }}
51-
URI_GITRANKS_BUILD=${{ secrets.URI_GITRANKS_BUILD }}
50+
URI_GITRANKS=${{ secrets.URI_GITRANKS_BUILD }}
5251
5352
# 4. SSH to droplet and deploy
5453
- name: SSH to droplet and deploy
@@ -73,7 +72,6 @@ jobs:
7372
-e AUTH_SECRET='${{ secrets.AUTH_SECRET }}' \
7473
-e AUTH_GITHUB_SECRET='${{ secrets.AUTH_GITHUB_SECRET }}' \
7574
-e URI_GITRANKS='${{ vars.URI_GITRANKS }}' \
76-
-e URI_GITRANKS_BUILD='${{ secrets.URI_GITRANKS_BUILD }}' \
7775
-e AUTH_GITHUB_ID='${{ vars.AUTH_GITHUB_ID }}' \
7876
-e AUTH_URL='${{ vars.AUTH_URL }}' \
7977
-e AUTH_TRUST_HOST=true \

Dockerfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ ENV INTERNAL_JWT_SECRET=$INTERNAL_JWT_SECRET
2424
ARG URI_GITRANKS
2525
ENV URI_GITRANKS=$URI_GITRANKS
2626

27-
ARG URI_GITRANKS_BUILD
28-
ENV URI_GITRANKS_BUILD=$URI_GITRANKS_BUILD
29-
3027
WORKDIR /app
3128
COPY --from=deps /app/node_modules ./node_modules
3229
COPY . .

lib/signed-fetch.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,5 @@ export async function signedFetch(path: string, init: RequestInit = {}) {
88
const headers = new Headers(init.headers);
99
headers.set('Authorization', `Bearer ${token}`);
1010

11-
const apiUrl =
12-
process.env.NEXT_PHASE === 'phase-production-build' ? process.env.URI_GITRANKS_BUILD! : process.env.URI_GITRANKS!;
13-
14-
return fetch(`${apiUrl}${path}`, { ...init, headers });
11+
return fetch(`${process.env.URI_GITRANKS!}${path}`, { ...init, headers });
1512
}

0 commit comments

Comments
 (0)