Skip to content

Deploy to Dev

Deploy to Dev #578

Workflow file for this run

name: Deploy to Dev
on:
workflow_dispatch:
inputs:
aimmo-branch:
description: "aimmo branch"
required: false
default: ""
portal-branch:
description: "portal branch"
required: false
default: ""
rapid-router-branch:
description: "rapid-router branch"
required: false
default: ""
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
environment: dev
env:
APP_ID: decent-digit-629
NODE_ENV: production
DB_PORT: 3306
GKE_ZONE: europe-west1-b
MODULE_NAME: dev
VERSION: ${{ github.run_number }}
DATABASE_POSTFIX: ${{ secrets.DATABASE_POSTFIX }}
permissions:
contents: 'read'
id-token: 'write'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.8.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 }}
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 }}
react-app-kurono-badges-url: ${{ secrets.REACT_APP_KURONO_BADGES_URL }}
aimmo-branch: ${{ github.event.inputs.aimmo-branch }}
portal-branch: ${{ github.event.inputs.portal-branch }}
rapid-router-branch: ${{ github.event.inputs.rapid-router-branch }}
- name: Notify successful deployment
if: ${{ success() }}
run: ./notify_deployment.py
env:
DEPLOY_NOTIFY_URL: ${{ secrets.DEPLOY_NOTIFY_URL }}
AIMMO_BRANCH: ${{ github.event.inputs.aimmo-branch }}
PORTAL_BRANCH: ${{ github.event.inputs.portal-branch }}
RAPID_ROUTER_BRANCH: ${{ github.event.inputs.rapid-router-branch }}
- name: Notify failed deployment
if: ${{ failure() }}
run: ./notify_deployment.py 0
env:
DEPLOY_NOTIFY_URL: ${{ secrets.DEPLOY_NOTIFY_URL }}