Skip to content

Deploy to Default

Deploy to Default #145

name: Deploy to Default
on: workflow_dispatch
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
environment: default
env:
APP_ID: decent-digit-629
NODE_ENV: production
DB_PORT: 3306
GKE_ZONE: europe-west1-b
MODULE_NAME: default
VERSION: ${{ github.run_number }}
DATABASE_POSTFIX: ${{ secrets.DATABASE_POSTFIX }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.8.x"
architecture: "x64"
- id: gcauth
name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCLOUD_AUTH }}
- name: Setup gcloud CLI
uses: google-github-actions/setup-gcloud@v2
- name: GKE auth
uses: simenandre/setup-gke-gcloud-auth-plugin@v1
- 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 }}
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 }}
- 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 }}