test the workflow #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to Google App Engine | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
environment: Dev Test | |
runs-on: ubuntu-latest | |
steps: | |
- 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: 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: | | |
touch ${GOOGLE_APPLICATION_CREDENTIALS} | |
cat ${{ secrets.GCP_CREDENTIALS}} > ${GOOGLE_APPLICATION_CREDENTIALS} | |
gcloud --quiet --project ${{secrets.GCP_PROJECT_ID }} app deploy app.yaml |