Skip to content

Manual Deploy [boxel] #577

Manual Deploy [boxel]

Manual Deploy [boxel] #577

Workflow file for this run

name: Manual Deploy [boxel]
on:
workflow_dispatch:
inputs:
environment:
description: Deployment environment
required: false
default: staging
workflow_call:
inputs:
environment:
required: true
type: string
jobs:
build-ai-bot:
name: Build ai-bot Docker image
uses: cardstack/gh-actions/.github/workflows/docker-ecr.yml@main
secrets: inherit
with:
repository: "boxel-ai-bot-${{ inputs.environment }}"
environment: ${{ inputs.environment }}
dockerfile: "packages/ai-bot/Dockerfile"
deploy-ai-bot:
needs: [build-ai-bot, post-migrate-db]
name: Deploy ai-bot to AWS ECS
uses: cardstack/gh-actions/.github/workflows/ecs-deploy.yml@main
secrets: inherit
with:
container-name: "boxel-ai-bot"
environment: ${{ inputs.environment }}
cluster: ${{ inputs.environment }}
service-name: "boxel-ai-bot-${{ inputs.environment }}"
image: ${{ needs.build-ai-bot.outputs.image }}
wait-for-service-stability: false
build-host:
name: Build host
uses: ./.github/workflows/build-host.yml
secrets: inherit
with:
environment: ${{ inputs.environment }}
deploy-host:
name: Deploy host
needs: [build-host]
uses: ./.github/workflows/deploy-host.yml
secrets: inherit
with:
environment: ${{ inputs.environment }}
deploy-motion:
name: Deploy boxel-motion
if: inputs.environment == 'staging'
uses: ./.github/workflows/deploy-motion.yml
secrets: inherit
with:
environment: staging
deploy-ui:
name: Deploy boxel-ui
if: inputs.environment == 'staging'
uses: ./.github/workflows/deploy-ui.yml
secrets: inherit
with:
environment: staging
build-realm-server:
name: Build realm-server Docker image
uses: cardstack/gh-actions/.github/workflows/docker-ecr.yml@main
secrets: inherit
with:
repository: "boxel-realm-server-${{ inputs.environment }}"
environment: ${{ inputs.environment }}
dockerfile: "packages/realm-server/Dockerfile"
build-args: |
"realm_server_script=start:${{ inputs.environment }}"
build-pg-migration:
name: Build pg-migration Docker image
uses: cardstack/gh-actions/.github/workflows/docker-ecr.yml@main
secrets: inherit
with:
repository: "boxel-pg-migration-${{ inputs.environment }}"
environment: ${{ inputs.environment }}
dockerfile: "packages/postgres/Dockerfile"
migrate-db:
# use "deploy-host" and "build-realm-server" as deps so we can run
# migrations at last possible moment in order to reduce the amount of time
# that old code is pointing to new schema
needs: [build-pg-migration, build-realm-server, deploy-host]
name: Deploy and run DB migrations
uses: cardstack/gh-actions/.github/workflows/ecs-deploy.yml@main
secrets: inherit
with:
container-name: "boxel-pg-migration"
environment: ${{ inputs.environment }}
cluster: ${{ inputs.environment }}
service-name: "boxel-pg-migration-${{ inputs.environment }}"
image: ${{ needs.build-pg-migration.outputs.image }}
wait-for-service-stability: false
post-migrate-db:
name: Wait for db-migration
needs: [migrate-db]
runs-on: ubuntu-latest
steps:
- run: sleep 240
deploy-realm-server:
name: Deploy realm server
needs: [build-realm-server, deploy-host, post-migrate-db]
uses: cardstack/gh-actions/.github/workflows/ecs-deploy.yml@main
secrets: inherit
with:
container-name: "boxel-realm-server"
environment: ${{ inputs.environment }}
cluster: ${{ inputs.environment }}
service-name: "boxel-realm-server-${{ inputs.environment }}"
image: ${{ needs.build-realm-server.outputs.image }}
wait-for-service-stability: false