Skip to content

Commit

Permalink
test the workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Serhiy1 committed Mar 27, 2024
1 parent f3ea445 commit f853953
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Deploy to Google App Engine
on:
push:
branches:
- master
- main
jobs:
deploy:
environment: Dev Test
Expand All @@ -16,16 +16,18 @@ 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 }}
touch $GOOGLE_GHA_CREDS_PATH
echo ${{ secrets.GCP_CREDENTIALS}} > ${GOOGLE_GHA_CREDS_PATH}
gcloud app deploy
7 changes: 6 additions & 1 deletion app.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
runtime: nodejs20
env: standard
env: standard


env_variables:
JWTKey: JWTKEY_PLACEHOLDER
MongoConnectionString: MONGOCONNECTIONSTRING_PLACEHOLDER
3 changes: 3 additions & 0 deletions src/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@ const errorHandler: ErrorRequestHandler = (err: HttpError | Error, req: Request,
};

app.use(errorHandler);


// test

0 comments on commit f853953

Please sign in to comment.