From da86ec1983c0f99773b2833479f84b0150b459d6 Mon Sep 17 00:00:00 2001 From: Jaydin_MacBook Date: Wed, 10 Jan 2024 16:01:51 -0500 Subject: [PATCH] Credentials in GH Secrets --- .github/workflows/docker-image.yml | 2 ++ backend/Dockerfile | 10 +++++++++- backend/settings.yaml | 1 - 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 494ea7e..cbdd11b 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -35,6 +35,8 @@ jobs: themanwholikestocode/archive-me-prod:backend-${{ github.event_name == 'pull_request' && 'development' || 'production' }} build-args: | CLIENT_SECRET_JSON=${{ secrets.CLIENT_SECRET_JSON }} + GOOGLE_CLIENT_SECRET=${{ secrets.GOOGLE_CLIENT_SECRET }} + GOOGLE_CLIENT_ID=${{ secrets.GOOGLE_CLIENT_ID }} frontend-build: runs-on: ubuntu-latest diff --git a/backend/Dockerfile b/backend/Dockerfile index 6c797f9..136aa80 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -4,9 +4,17 @@ WORKDIR /backend ADD . /backend +ARG GOOGLE_CLIENT_SECRET + +ENV GOOGLE_CLIENT_SECRET=$GOOGLE_CLIENT_SECRET + +ARG GOOGLE_CLIENT_ID + +ENV GOOGLE_CLIENT_ID=$GOOGLE_CLIENT_ID + ARG CLIENT_SECRET_JSON -RUN echo "$CLIENT_SECRET_JSON" > /backend/client_secret.json +RUN echo "$CLIENT_CREDENTIALS_JSON" > /backend/credentials.json RUN pip install -r requirements.txt diff --git a/backend/settings.yaml b/backend/settings.yaml index ee9a4fb..df67398 100644 --- a/backend/settings.yaml +++ b/backend/settings.yaml @@ -1,5 +1,4 @@ client_config_backend: settings -client_secrets_file: client_secrets.json client_config: client_id: ${GOOGLE_CLIENT_ID} client_secret: ${GOOGLE_CLIENT_SECRET}