Skip to content

Commit

Permalink
Merge pull request #2415 from airqo-platform/website-readiness-checl
Browse files Browse the repository at this point in the history
Adding Readiness checks and upscaling instances to handle Website deployments
  • Loading branch information
Baalmart authored Jan 27, 2025
2 parents b5ac692 + db038d7 commit 6e02ef2
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/deploy-frontends-to-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,12 @@ jobs:
echo "runtime_config:" >> app.yaml
echo " operating_system: \"ubuntu22\"" >> app.yaml
echo " runtime_version: \"3.12\"" >> app.yaml
echo "readiness_check:" >> app.yaml
echo " check_interval_sec: 10" >> app.yaml
echo " timeout_sec: 15" >> app.yaml
echo " failure_threshold: 2" >> app.yaml
echo " success_threshold: 2" >> app.yaml
echo " app_start_timeout_sec: 1800" >> app.yaml
echo "========== Creating .env.yaml file =========="
echo "env_variables:" > .env.yaml
echo " SECRET: ${{ secrets.WEBSITE_SECRET }}" >> .env.yaml
Expand All @@ -295,6 +301,11 @@ jobs:
echo " DEBUG: False" >> .env.yaml
echo " GOOGLE_APPLICATION_CREDENTIALS: /app/google_application_credentials.json" >> .env.yaml
- name: Temporarily Increase Min Instances
run: |
echo "========== Setting minimum instances to 2 for deployment =========="
gcloud app services update default --min-instances=2 --quiet
- name: Build and Push Docker Image
run: |
cd website2/
Expand All @@ -314,6 +325,11 @@ jobs:
--image-url=${{ env.REGISTRY_URL }}/${{ secrets.FRONTEND_PROJECT_ID }}/airqo-website2:latest \
--project=${{ secrets.FRONTEND_PROJECT_ID }} \
--quiet
- name: Restore Min Instances
run: |
echo "========== Restoring minimum instances to 1 after deployment =========="
gcloud app services update default --min-instances=1 --quiet
- name: Delete Old Versions
run: |-
Expand Down

0 comments on commit 6e02ef2

Please sign in to comment.