Skip to content

Commit

Permalink
Update envs
Browse files Browse the repository at this point in the history
  • Loading branch information
arkadiuszbachorski committed Jun 11, 2024
1 parent 63513ef commit cf8a677
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,12 @@ jobs:
with:
dockerComposeFile: docker-compose-development.yml
testscript: test.sh
secrets:
ENV_FILE: |
NEXT_PUBLIC_FIREBASE_API_KEY='${{ secrets.NEXT_PUBLIC_FIREBASE_API_KEY }}'
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN='${{ secrets.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN }}'
NEXT_PUBLIC_FIREBASE_PROJECT_ID='${{ secrets.NEXT_PUBLIC_FIREBASE_PROJECT_ID }}'
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET='${{ secrets.NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET }}'
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID='${{ secrets.NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID }}'
NEXT_PUBLIC_FIREBASE_APP_ID='${{ secrets.NEXT_PUBLIC_FIREBASE_APP_ID }}'
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ COPY . .
# Uncomment the following line in case you want to disable telemetry during the build.
ENV NEXT_TELEMETRY_DISABLED 1

ARG NEXT_PUBLIC_FIREBASE_API_KEY
ARG NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN
ARG NEXT_PUBLIC_FIREBASE_PROJECT_ID
ARG NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET
ARG NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID
ARG NEXT_PUBLIC_FIREBASE_APP_ID

RUN npm run build

# Production image, copy all the files and run next
Expand Down
7 changes: 7 additions & 0 deletions docker-compose-development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ services:
build:
context: ./
dockerfile: ./Dockerfile
args:
- NEXT_PUBLIC_FIREBASE_API_KEY=${NEXT_PUBLIC_FIREBASE_API_KEY}
- NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=${NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN}
- NEXT_PUBLIC_FIREBASE_PROJECT_ID=${NEXT_PUBLIC_FIREBASE_PROJECT_ID}
- NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=${NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET}
- NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=${NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID}
- NEXT_PUBLIC_FIREBASE_APP_ID=${NEXT_PUBLIC_FIREBASE_APP_ID}
expose:
- '80'
command: ['node', 'server.js']
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ services:
stanford-bdhg-engage-hf-web-frontend:
container_name: 'stanford-bdhg-engage-hf-web-frontend'
image: 'ghcr.io/stanfordbdhg/engagehfwebfrontend:latest'
environment:
- NEXT_PUBLIC_CHECK=${NEXT_PUBLIC_CHECK}
expose:
- '80'
command: ['node', 'server.js']
Expand Down
2 changes: 1 addition & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
set -e

CONTENT=$(curl --fail http://localhost)
echo "$CONTENT" | grep "Welcome to the Stanford Biodesign Digital Health ENGAGE-HF Web Frontend"
echo "$CONTENT" | grep "ENGAGE-HF"

echo "✅ Test Passed!"

0 comments on commit cf8a677

Please sign in to comment.