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 b607bf2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
21 changes: 11 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,30 @@ name: Deploy to Google App Engine
on:
push:
branches:
- master
- main
jobs:
deploy:
environment: Dev Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- id: auth
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_CREDENTIALS }}

- 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 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 b607bf2

Please sign in to comment.