diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9ebe02f..5f981a0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,7 +3,7 @@ name: Deploy to Google App Engine on: push: branches: - - master + - main jobs: deploy: environment: Dev Test @@ -23,9 +23,12 @@ jobs: - name: Checkout code uses: actions/checkout@v2 + + - name: Inject Environment Variables into app.yaml + run: | + sed -i 's|JWTKEY_PLACEHOLDER|${{ secrets.JWTKEY }}|' app.yaml + sed -i 's|MONGOCONNECTIONSTRING_PLACEHOLDER|${{ secrets.MONGOCONNECTIONSTRING }}|' app.yaml + - name: Deploy to Google App Engine run: | - gcloud app deploy --quiet \ - --set-env-vars \ - JWTKey=${{ secrets.JWTKEY }},\ - MongoConnectionString=${{ secrets.MONGOCONNECTIONSTRING }} + gcloud app deploy \ No newline at end of file diff --git a/app.yaml b/app.yaml index e53f1f0..e65f00b 100644 --- a/app.yaml +++ b/app.yaml @@ -1,2 +1,7 @@ runtime: nodejs20 -env: standard \ No newline at end of file +env: standard + + +env_variables: + JWTKey: JWTKEY_PLACEHOLDER + MongoConnectionString: MONGOCONNECTIONSTRING_PLACEHOLDER \ No newline at end of file diff --git a/src/app/app.ts b/src/app/app.ts index 9aeb228..95bd541 100644 --- a/src/app/app.ts +++ b/src/app/app.ts @@ -45,3 +45,6 @@ const errorHandler: ErrorRequestHandler = (err: HttpError | Error, req: Request, }; app.use(errorHandler); + + +// test