From 54a0d0a9341699f723e1fe3f91fcc93fad535d85 Mon Sep 17 00:00:00 2001 From: serhiy Date: Wed, 27 Mar 2024 17:30:47 +0000 Subject: [PATCH] test the workflow --- .github/workflows/main.yml | 16 ++++++++-------- app.yaml | 7 ++++++- src/app/app.ts | 3 +++ 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9ebe02f..6125a5b 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 @@ -16,16 +16,16 @@ jobs: - name: Set up Cloud SDK uses: google-github-actions/setup-gcloud@v2 - - - name: Set default GCP project - run: gcloud config set project ${{ secrets.GCP_PROJECT_ID }} - 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 + cat app.yaml + - name: Deploy to Google App Engine run: | - gcloud app deploy --quiet \ - --set-env-vars \ - JWTKey=${{ secrets.JWTKEY }},\ - MongoConnectionString=${{ secrets.MONGOCONNECTIONSTRING }} + gcloud --quiet --project ${{secrets.GCP_PROJECT_ID }} app deploy app.yaml \ 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