Skip to content

Commit

Permalink
fix: env
Browse files Browse the repository at this point in the history
  • Loading branch information
Toto-hitori committed Mar 8, 2024
1 parent 8c20bae commit 7850937
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name: Deploy on release
on:
release:
types: [published]
push:
branches:
- master

jobs:
unit-tests:
Expand Down Expand Up @@ -105,8 +108,5 @@ jobs:
echo "DATABASE_USER=${{ secrets.DATABASE_USER }}" >> .env
echo "DATABASE_PASSWORD=${{ secrets.DATABASE_PASSWORD }}" >> .env
echo "JWT_SECRET=${{ secrets.JWT_SECRET }}" >> .env
cd webapp
echo "REACT_APP_API_ENDPOINT=http://${{ secrets.DEPLOY_HOST }}:8080" >> .env
cd ../
sudo docker compose down
sudo docker compose --profile prod up -d
5 changes: 4 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ services:
container_name: webapp-${teamname:-defaultASW}
image: ghcr.io/arquisoft/wiq_en2b/webapp:latest
profiles: [ "dev", "prod" ]
build: ./webapp
build:
context: ./webapp
args:
API_URI: ${http://${{ secrets.DEPLOY_HOST }}:8080}
networks:
- mynetwork
ports:
Expand Down
2 changes: 1 addition & 1 deletion webapp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ WORKDIR /app
#Install the dependencies
RUN npm install

ARG API_URI="http://localhost:8000"
ARG API_URI
ENV REACT_APP_API_ENDPOINT=$API_URI

#Create an optimized version of the webapp
Expand Down

0 comments on commit 7850937

Please sign in to comment.