Skip to content

Deploy to Staging #1046

Deploy to Staging

Deploy to Staging #1046

name: Deploy to Staging
on: workflow_dispatch
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
environment: staging
env:
APP_ID: decent-digit-629
NODE_ENV: production
DB_PORT: 5432
GKE_ZONE: europe-west1-b
MODULE_NAME: staging
VERSION: ${{ github.run_number }}
permissions:
id-token: 'write'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12.x"
architecture: "x64"
- id: auth
name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
project_id: 'decent-digit-629'
workload_identity_provider: 'projects/354656325390/locations/global/workloadIdentityPools/cfl-pool/providers/cfl-provider'
service_account: '[email protected]'
- name: Setup gcloud CLI
uses: google-github-actions/setup-gcloud@v2
- name: Deploy to Google Cloud
uses: ./.github/actions/deploy_gcloud
with:
app-id: ${{ env.APP_ID }}
module-name: ${{ env.MODULE_NAME }}
gke-zone: ${{ env.GKE_ZONE }}
version: ${{ env.VERSION }}
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
database-host: ${{ secrets.DATABASE_HOST }}
database-name: ${{ secrets.DATABASE_NAME }}
database-password: ${{ secrets.DATABASE_PASSWORD }}
django-secret: ${{ secrets.DJANGO_SECRET }}
django-portal-contact-form-email: ${{ secrets.DJANGO_PORTAL_CONTACT_FORM_EMAIL }}
dotmailer-create-contact-url: ${{ secrets.DOTMAILER_CREATE_CONTACT_URL }}
dotmailer-main-address-book-url: ${{ secrets.DOTMAILER_MAIN_ADDRESS_BOOK_URL }}
dotmailer-teacher-address-book-url: ${{ secrets.DOTMAILER_TEACHER_ADDRESS_BOOK_URL }}
dotmailer-student-address-book-url: ${{ secrets.DOTMAILER_STUDENT_ADDRESS_BOOK_URL }}
dotmailer-no-account-address-book-url: ${{ secrets.DOTMAILER_NO_ACCOUNT_ADDRESS_BOOK_URL }}
dotmailer-get-user-by-email-url: ${{ secrets.DOTMAILER_GET_USER_BY_EMAIL_URL }}
dotmailer-delete-user-by-id-url: ${{ secrets.DOTMAILER_DELETE_USER_BY_ID_URL }}
dotmailer-put-consent-data-url: ${{ secrets.DOTMAILER_PUT_CONSENT_DATA_URL }}
dotmailer-send-campaign-url: ${{ secrets.DOTMAILER_SEND_CAMPAIGN_URL }}
dotmailer-thanks-for-staying-campaign-id: ${{ secrets.DOTMAILER_THANKS_FOR_STAYING_CAMPAIGN_ID }}
dotmailer-user: ${{ secrets.DOTMAILER_USER }}
dotmailer-password: ${{ secrets.DOTMAILER_PASSWORD }}
dotmailer-default-preferences: ${{ secrets.DOTMAILER_DEFAULT_PREFERENCES }}
dotdigital-auth: ${{ secrets.DOTDIGITAL_AUTH }}
recaptcha-public-key: ${{ secrets.RECAPTCHA_PUBLIC_KEY }}
recaptcha-private-key: ${{ secrets.RECAPTCHA_PRIVATE_KEY }}
redis-ip: ${{ secrets.REDIS_IP }}
redis-port: ${{ secrets.REDIS_PORT }}
- name: Notify successful deployment
if: ${{ success() }}
run: ./notify_deployment.py
env:
DEPLOY_NOTIFY_URL: ${{ secrets.DEPLOY_NOTIFY_URL }}
- name: Notify failed deployment
if: ${{ failure() }}
run: ./notify_deployment.py 0
env:
DEPLOY_NOTIFY_URL: ${{ secrets.DEPLOY_NOTIFY_URL }}