Skip to content
This repository was archived by the owner on Jul 2, 2020. It is now read-only.

Commit 37caf4a

Browse files
committed
Given the env vars to the build process
1 parent 6b08037 commit 37caf4a

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

.github/workflows/web.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ jobs:
3434
- name: Docker build and push
3535
working-directory: ./web
3636
run: |
37-
docker build . -t registry.multisolution.art.br/multi:web
37+
docker build . -t registry.multisolution.art.br/multi:web \
38+
--build-arg API_URL=${{ secrets.MULTI_API_URL }} \
39+
--build-arg SUBSCRIPTIONS_URL=${{ secrets.MULTI_SUBSCRIPTIONS_URL }}
3840
docker push registry.multisolution.art.br/multi:web
3941
4042
- name: Deploy

web/Dockerfile

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
FROM node AS build
2+
ARG API_URL
3+
ARG SUBSCRIPTIONS_URL
4+
ENV API_URL=${API_URL}
5+
ENV SUBSCRIPTIONS_URL=${SUBSCRIPTIONS_URL}
26
COPY . /app
37
WORKDIR /app
48
RUN npm install && npm run build

web/lib/apollo.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ function createApolloClient(initialState: any, getToken: GetToken): ApolloClient
121121

122122
if (typeof window !== "undefined") {
123123
const wsLink = new WebSocketLink({
124-
uri: process.env.WS_URL || 'ws://localhost:8001',
124+
uri: process.env.SUBSCRIPTIONS_URL || 'ws://localhost:8001',
125125
options: {
126126
reconnect: true,
127127
},

web/next.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
env: {
33
API_URL: process.env.API_URL,
4-
WS_URL: process.env.WS_URL
4+
SUBSCRIPTIONS_URL: process.env.SUBSCRIPTIONS_URL
55
}
66
};

0 commit comments

Comments
 (0)