File tree Expand file tree Collapse file tree 7 files changed +30
-42
lines changed Expand file tree Collapse file tree 7 files changed +30
-42
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ permissions:
1212
1313jobs :
1414 build :
15- name : Build and push Docker image to GHCR
15+ name : Build and push prod Docker image to GHCR
1616 runs-on : ubuntu-latest
1717
1818 steps :
4545 - name : Build and (if not PR) push
4646 uses : docker/build-push-action@v5
4747 with :
48+ build-args : |
49+ NEXT_PUBLIC_DJANGO_URL="https://frikanalen.no/api/"
50+ NEXT_PUBLIC_UPLOAD_URL="https://upload.frikanalen.no/files"
4851 push : ${{ github.event_name != 'pull_request' }}
4952 tags : ${{ steps.meta.outputs.tags }}
5053 labels : ${{ steps.meta.outputs.labels }}
Original file line number Diff line number Diff line change @@ -12,6 +12,11 @@ COPY . .
1212ENV NEXT_TELEMETRY_DISABLED 1
1313ENV NEXT_PUBLIC_ENV production
1414
15+ ARG NEXT_PUBLIC_DJANGO_URL
16+ ARG NEXT_PUBLIC_UPLOAD_URL
17+
18+ ENV NEXT_PUBLIC_DJANGO_URL=$NEXT_PUBLIC_DJANGO_URL
19+ ENV NEXT_PUBLIC_UPLOAD_URL=$NEXT_PUBLIC_UPLOAD_URL
1520RUN yarn build
1621
1722FROM node:18-bullseye AS runner
Original file line number Diff line number Diff line change 1+ import * as z from "zod"
2+
3+ const PublicEnvSchema = z . object ( {
4+ NEXT_PUBLIC_DJANGO_URL : z . string ( ) ,
5+ NEXT_PUBLIC_UPLOAD_URL : z . string ( ) ,
6+ } )
7+
8+ export const env = PublicEnvSchema . parse ( {
9+ NEXT_PUBLIC_DJANGO_URL : process . env . NEXT_PUBLIC_DJANGO_URL ,
10+ NEXT_PUBLIC_UPLOAD_URL : process . env . NEXT_PUBLIC_UPLOAD_URL ,
11+ } )
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11import axios , { AxiosInstance } from "axios" ;
2- import configs from "../config" ;
32import { IS_SERVER } from "modules/core/constants" ;
43import { createStoreFactory , Store } from "modules/state/classes/Store" ;
54import { NextPageContext } from "next" ;
65import cookie from "cookie" ;
76import { THE_END_OF_TIMES } from "../constants" ;
7+ import { env } from "../../core/env" ;
88
99export class NetworkStore extends Store {
1010 public incomingHeaders : Record < string , string > = { } ;
@@ -60,15 +60,15 @@ export class NetworkStore extends Store {
6060
6161 this . apiInstance = this . addInterceptors (
6262 axios . create ( {
63- baseURL : configs . api ,
63+ baseURL : env . NEXT_PUBLIC_DJANGO_URL ,
6464 withCredentials : true ,
6565 headers, // FIXME: JUST TO GET BUILD RUNNING
6666 } )
6767 ) ;
6868
6969 this . uploadInstance = this . addInterceptors (
7070 axios . create ( {
71- baseURL : configs . upload ,
71+ baseURL : env . NEXT_PUBLIC_UPLOAD_URL ,
7272 withCredentials : true ,
7373 headers,
7474 } )
Original file line number Diff line number Diff line change 4141 "react-transition-group" : " ^4.4.2" ,
4242 "react-twitter-widgets" : " ^1.10.0" ,
4343 "shaka-player" : " ^4.1.1" ,
44- "shaka-player-react" : " ^1.0.1"
44+ "shaka-player-react" : " ^1.0.1" ,
45+ "zod" : " ^3.25.76"
4546 },
4647 "devDependencies" : {
4748 "@babel/plugin-proposal-decorators" : " ^7.15.8" ,
Original file line number Diff line number Diff line change @@ -3378,3 +3378,8 @@ yaml@^2.1.1:
33783378 version "2.1.1"
33793379 resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.1.1.tgz#1e06fb4ca46e60d9da07e4f786ea370ed3c3cfec"
33803380 integrity sha512-o96x3OPo8GjWeSLF+wOAbrPfhFOGY0W00GNaxCDv+9hkcDJEnev1yh8S7pgHF0ik6zc8sQLuL8hjHjJULZp8bw==
3381+
3382+ zod@^3.25.76 :
3383+ version "3.25.76"
3384+ resolved "https://registry.yarnpkg.com/zod/-/zod-3.25.76.tgz#26841c3f6fd22a6a2760e7ccb719179768471e34"
3385+ integrity sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==
You can’t perform that action at this time.
0 commit comments