From 4a2c02638b969a4e4addd08146f157b5de630aa0 Mon Sep 17 00:00:00 2001 From: Garrett Stevens Date: Tue, 19 Mar 2024 23:43:24 -0600 Subject: [PATCH] Properly pass env variables to container --- .github/workflows/deploy/compose.yml | 5 +++++ .github/workflows/push.yml | 13 +++++++++---- .../apollo-collaboration-server/src/app.module.ts | 2 +- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy/compose.yml b/.github/workflows/deploy/compose.yml index 0151896c1..ce2329421 100644 --- a/.github/workflows/deploy/compose.yml +++ b/.github/workflows/deploy/compose.yml @@ -11,6 +11,11 @@ services: FILE_UPLOAD_FOLDER: /data/uploads LOG_LEVELS: error,warn,log,debug ALLOW_GUEST_USER: true + URL: ${URL} + JWT_SECRET: ${JWT_SECRET} + SESSION_SECRET: ${SESSION_SECRET} + GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID} + GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET} ports: - 3999:3999 volumes: diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index f36d73ff2..66f9aa3ad 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -6,12 +6,14 @@ on: inputs: publish: description: 'Build and publish Docker image' - required: false type: boolean + required: false + default: false deploy: description: 'Deploy to demo server' - required: false type: boolean + required: false + default: false jobs: build: @@ -58,7 +60,9 @@ jobs: build-and-push-docker: name: Build and push Docker image runs-on: ubuntu-latest - if: ${{ github.ref == 'refs/heads/main' || inputs.publish }} + if: + ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || + inputs.publish }} steps: - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -87,7 +91,8 @@ jobs: environment: staging needs: build-and-push-docker if: - ${{ github.ref == 'refs/heads/main' || ( inputs.deploy && always()) }} + ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || + ( inputs.deploy && always()) }} steps: - name: Check out uses: actions/checkout@v3 diff --git a/packages/apollo-collaboration-server/src/app.module.ts b/packages/apollo-collaboration-server/src/app.module.ts index a5b456e82..704c3cad6 100644 --- a/packages/apollo-collaboration-server/src/app.module.ts +++ b/packages/apollo-collaboration-server/src/app.module.ts @@ -38,7 +38,7 @@ const nodeEnv = process.env.NODE_ENV ?? 'production' const validationSchema = Joi.object({ // Required URL: Joi.string().uri().required(), - MONGODB_URI: Joi.string().uri(), + MONGODB_URI: Joi.string(), MONGODB_URI_FILE: Joi.string(), FILE_UPLOAD_FOLDER: Joi.string().required(), GOOGLE_CLIENT_ID: Joi.string(),