Skip to content

Deploy UrbanOS

Deploy UrbanOS #162

name: Deploy UrbanOS
on:
workflow_dispatch:
inputs:
skip-andi-init:
type: boolean
description: Skip initializing andi. Enable this skip if not deploying to demo-urbanos.com. Useful to enable this if Andi has already been initialized, and you'd only like to apply the terraform.
use-staging-lets-encrypt:
type: boolean
description: Use staging lets encrypt instead of prod. When enabled, deployments of juno won't count towards the 5 prod certs a week rate limit. More info in the .env file.
enable-sauron:
type: boolean
description: Deploy Sauron, a cron job that will keep this environment up to date. Permanently disabled in demo environment.
environment:
type: choice
description: Choose the environment used to deploy urbanos.
options:
- dev1
- qual
- uat
- demo
required: true
jobs:
Deploy_UrbanOS:
runs-on: ubuntu-latest
environment: ${{ github.event.inputs.environment }}-urbanos.com
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16.19.0
- run: npm ci
- name: Generate module and provider bindings
run: npx cdktf-cli@0.15.5 get
- name: Run Terraform CDK and to generate Terraform
uses: hashicorp/terraform-cdk-action@v0.1.13
with:
terraformVersion: 1.3.7
cdktfVersion: 0.15.5
stackName: juno
mode: auto-approve-apply
commentOnPr: false
env:
# ensure edits to these are added to the "teardown_urbanos" workflow as well
# in order of .env file secrets and of github action secrets list
ENV: ${{ github.event.inputs.environment }}
AUTH0_USER_API_KEY: ${{secrets.AUTH0_USER_API_KEY}}
JUNO_ANDI_AUTH0_CLIENT_SECRET: ${{secrets.JUNO_ANDI_AUTH0_CLIENT_SECRET}}
JUNO_AZURE_SUB_ID: ${{secrets.JUNO_AZURE_SUB_ID}}
JUNO_DEMO_AZURE_APP_ID: ${{secrets.JUNO_DEMO_AZURE_APP_ID}}
JUNO_DEMO_AZURE_PASSWORD: ${{secrets.JUNO_DEMO_AZURE_PASSWORD}}
JUNO_DEMO_AZURE_TENANT: ${{secrets.JUNO_DEMO_AZURE_TENANT}}
JUNO_DEMO_TF_BACKEND_KEY: ${{secrets.JUNO_DEMO_TF_BACKEND_KEY}}
JUNO_DEMO_TF_ORGANIZATION_NAME: ${{vars.JUNO_DEMO_TF_ORGANIZATION_NAME}}
JUNO_DEMO_TF_WORKSPACE_NAME: ${{vars.JUNO_DEMO_TF_WORKSPACE_NAME}}
JUNO_DOMAIN_NO_SUFFIX: ${{vars.JUNO_DOMAIN_NO_SUFFIX}}
JUNO_DOMAIN_WITH_SUFFIX: ${{vars.JUNO_DOMAIN_WITH_SUFFIX}}
JUNO_EVENT_HUB_URL: ${{secrets.JUNO_EVENT_HUB_URL}}
JUNO_RAPTOR_AUTH0_CLIENT_SECRET: ${{secrets.JUNO_RAPTOR_AUTH0_CLIENT_SECRET}}
JUNO_RESOURCE_PREFIX: ${{vars.JUNO_RESOURCE_PREFIX}}
JUNO_USE_STAGING_LETS_ENCRYPT: ${{github.event.inputs.use-staging-lets-encrypt}}
JUNO_ENABLE_SAURON: ${{github.event.inputs.enable-sauron}}
JUNO_SAURON_GITHUB_PAT: ${{secrets.JUNO_SAURON_GITHUB_PAT}}
URBANOS_CHART_VERSION: ${{vars.URBANOS_CHART_VERSION}}
- name: Initialize Andi Sample Datasets
if: ${{ github.event.inputs.skip-andi-init != 'true' }}
run: ./scripts/initialize_andi_req_data/initialize_andi.sh