Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Readiness checks and upscaling instances to handle Website deployments #2415

Merged
merged 2 commits into from
Jan 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading