Manual Deploy [hub] #462
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Manual Deploy [hub] | |
on: | |
workflow_dispatch: | |
inputs: | |
environment: | |
description: Deployment environment | |
required: false | |
default: staging | |
workflow_call: | |
inputs: | |
environment: | |
required: false | |
default: staging | |
type: string | |
permissions: | |
contents: read | |
id-token: write | |
jobs: | |
build: | |
name: Build Docker image | |
runs-on: ubuntu-latest | |
outputs: | |
image-server: ${{ steps.build-server.outputs.tag_sha }} | |
image-worker: ${{ steps.build-worker.outputs.tag_sha }} | |
image-event-listener: ${{ steps.build-event-listener.outputs.tag_sha }} | |
image-bot: ${{ steps.build-bot.outputs.tag_sha }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/init | |
- run: yarn build | |
working-directory: packages/hub | |
- name: Build hub-server | |
uses: cardstack/gh-actions/docker-ecr@main | |
id: build-server | |
with: | |
repository: "hub-server-${{ inputs.environment }}" | |
environment: ${{ inputs.environment }} | |
dockerfile: "packages/hub/Dockerfile" | |
context: "packages/hub" | |
build-args: | | |
hub_command=server | |
- name: Build hub-worker | |
uses: cardstack/gh-actions/docker-ecr@main | |
id: build-worker | |
with: | |
repository: "hub-worker-${{ inputs.environment }}" | |
environment: ${{ inputs.environment }} | |
dockerfile: "packages/hub/Dockerfile" | |
context: "packages/hub" | |
build-args: | | |
hub_command=worker | |
- name: Build hub-event-listener | |
uses: cardstack/gh-actions/docker-ecr@main | |
if: ${{ inputs.environment == 'production' }} | |
id: build-event-listener | |
with: | |
repository: "hub-event-listener-${{ inputs.environment }}" | |
environment: ${{ inputs.environment }} | |
dockerfile: "packages/hub/Dockerfile" | |
context: "packages/hub" | |
build-args: | | |
hub_command=event-listener | |
- name: Build hub-bot | |
uses: cardstack/gh-actions/docker-ecr@main | |
if: ${{ false }} | |
id: build-bot | |
with: | |
repository: "hub-bot-${{ inputs.environment }}" | |
environment: ${{ inputs.environment }} | |
dockerfile: "packages/hub/Dockerfile" | |
context: "packages/hub" | |
build-args: | | |
hub_command=bot | |
deploy-server: | |
needs: [build] | |
name: Deploy hub-server to AWS ECS | |
uses: cardstack/gh-actions/.github/workflows/ecs-deploy.yml@main | |
secrets: inherit | |
with: | |
container-name: "hub-server" | |
service-name: "hub-server-${{ inputs.environment }}" | |
environment: ${{ inputs.environment }} | |
cluster: ${{ inputs.environment }} | |
image: ${{ needs.build.outputs.image-server }} | |
deploy-worker: | |
needs: [build] | |
name: Deploy hub-worker to AWS ECS | |
uses: cardstack/gh-actions/.github/workflows/ecs-deploy.yml@main | |
secrets: inherit | |
with: | |
container-name: "hub-worker" | |
service-name: "hub-worker-${{ inputs.environment }}" | |
environment: ${{ inputs.environment }} | |
cluster: ${{ inputs.environment }} | |
image: ${{ needs.build.outputs.image-worker }} | |
deploy-event-listener: | |
needs: [build] | |
if: ${{ inputs.environment == 'production' }} | |
name: Deploy hub-event-listener to AWS ECS | |
uses: cardstack/gh-actions/.github/workflows/ecs-deploy.yml@main | |
secrets: inherit | |
with: | |
container-name: "hub-event-listener" | |
service-name: "hub-event-listener-${{ inputs.environment }}" | |
environment: ${{ inputs.environment }} | |
cluster: ${{ inputs.environment }} | |
image: ${{ needs.build.outputs.image-event-listener }} | |
deploy-bot: | |
needs: [build] | |
if: ${{ false }} | |
name: Deploy hub-bot to AWS ECS | |
uses: cardstack/gh-actions/.github/workflows/ecs-deploy.yml@main | |
secrets: inherit | |
with: | |
container-name: "hub-bot" | |
service-name: "hub-bot-${{ inputs.environment }}" | |
environment: ${{ inputs.environment }} | |
cluster: ${{ inputs.environment }} | |
image: ${{ needs.build.outputs.image-bot }} |