Skip to content

.github/workflows/production-deploy-new.yaml #131

.github/workflows/production-deploy-new.yaml

.github/workflows/production-deploy-new.yaml #131

name: Production Deploy New
on:
workflow_dispatch:
inputs:
deploy_search_sync_worker:
description: Deploy search-sync-worker service?
required: true
type: boolean
deploy_search_sync_api:
description: Deploy search-sync-api service?
required: true
type: boolean
deploy_integration_sync_worker:
description: Deploy integration-sync-worker service?
required: true
type: boolean
deploy_webhook_api:
description: Deploy webhook-api service?
required: true
type: boolean
deploy_automations_worker:
description: Deploy automations-worker service?
required: true
type: boolean
deploy_emails_worker:
description: Deploy emails-worker service?
required: true
type: boolean
deploy_script_executor:
description: Deploy script-executor service?
required: true
type: boolean
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
CROWD_CLUSTER: ${{ secrets.PRODUCTION_CLUSTER_NAME }}
CROWD_ROLE_ARN: ${{ secrets.PRODUCTION_CLUSTER_ROLE_ARN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
SLACK_CHANNEL: deploys
SLACK_WEBHOOK: ${{ secrets.PRODUCTION_SLACK_CHANNEL_HOOK }}
jobs:
build-and-push-search-sync-worker:
runs-on: ubuntu-latest
if: ${{ inputs.deploy_search_sync_worker }}
outputs:
image: ${{ steps.image.outputs.IMAGE }}
defaults:
run:
shell: bash
steps:
- name: Check out repository code
uses: actions/checkout@v2
- uses: ./.github/actions/build-docker-image
id: image-builder
with:
image: search-sync-worker
- name: Set docker image output
id: image
run: echo "IMAGE=${{ steps.image-builder.outputs.image }}" >> $GITHUB_OUTPUT
build-and-push-search-sync-api:
runs-on: ubuntu-latest
if: ${{ inputs.deploy_search_sync_api }}
outputs:
image: ${{ steps.image.outputs.IMAGE }}
defaults:
run:
shell: bash
steps:
- name: Check out repository code
uses: actions/checkout@v2
- uses: ./.github/actions/build-docker-image
id: image-builder
with:
image: search-sync-api
- name: Set docker image output
id: image
run: echo "IMAGE=${{ steps.image-builder.outputs.image }}" >> $GITHUB_OUTPUT
build-and-push-integration-sync-worker:
runs-on: ubuntu-latest
if: ${{ inputs.deploy_integration_sync_worker }}
outputs:
image: ${{ steps.image.outputs.IMAGE }}
defaults:
run:
shell: bash
steps:
- name: Check out repository code
uses: actions/checkout@v2
- uses: ./.github/actions/build-docker-image
id: image-builder
with:
image: integration-sync-worker
- name: Set docker image output
id: image
run: echo "IMAGE=${{ steps.image-builder.outputs.image }}" >> $GITHUB_OUTPUT
build-and-push-webhook-api:
runs-on: ubuntu-latest
if: ${{ inputs.deploy_webhook_api }}
outputs:
image: ${{ steps.image.outputs.IMAGE }}
defaults:
run:
shell: bash
steps:
- name: Check out repository code
uses: actions/checkout@v2
- uses: ./.github/actions/build-docker-image
id: image-builder
with:
image: webhook-api
- name: Set docker image output
id: image
run: echo "IMAGE=${{ steps.image-builder.outputs.image }}" >> $GITHUB_OUTPUT
build-and-push-automations-worker:
runs-on: ubuntu-latest
if: ${{ inputs.deploy_automations_worker }}
outputs:
image: ${{ steps.image.outputs.IMAGE }}
defaults:
run:
shell: bash
steps:
- name: Check out repository code
uses: actions/checkout@v2
- uses: ./.github/actions/build-docker-image
id: image-builder
with:
image: automations-worker
- name: Set docker image output
id: image
run: echo "IMAGE=${{ steps.image-builder.outputs.image }}" >> $GITHUB_OUTPUT
build-and-push-emails-worker:
runs-on: ubuntu-latest
if: ${{ inputs.deploy_emails_worker }}
outputs:
image: ${{ steps.image.outputs.IMAGE }}
defaults:
run:
shell: bash
steps:
- name: Check out repository code
uses: actions/checkout@v2
- uses: ./.github/actions/build-docker-image
id: image-builder
with:
image: emails-worker
- name: Set docker image output
id: image
run: echo "IMAGE=${{ steps.image-builder.outputs.image }}" >> $GITHUB_OUTPUT
build-and-push-script-executor:
runs-on: ubuntu-latest
if: ${{ inputs.deploy_script_executor }}
outputs:
image: ${{ steps.image.outputs.IMAGE }}
defaults:
run:
shell: bash
steps:
- name: Check out repository code
uses: actions/checkout@v2
- uses: ./.github/actions/build-docker-image
id: image-builder
with:
image: script-executor
- name: Set docker image output
id: image
run: echo "IMAGE=${{ steps.image-builder.outputs.image }}" >> $GITHUB_OUTPUT
deploy-search-sync-worker:
needs: build-and-push-search-sync-worker
runs-on: ubuntu-latest
if: ${{ inputs.deploy_search_sync_worker }}
defaults:
run:
shell: bash
steps:
- name: Check out repository code
uses: actions/checkout@v2
- uses: ./.github/actions/deploy-service
with:
service: search-sync-worker
image: ${{ needs.build-and-push-search-sync-worker.outputs.image }}
cluster: ${{ env.CROWD_CLUSTER }}
cloud_env: prod
prioritized: true
deploy-search-sync-api:
needs: build-and-push-search-sync-api
runs-on: ubuntu-latest
if: ${{ inputs.deploy_search_sync_api }}
defaults:
run:
shell: bash
steps:
- name: Check out repository code
uses: actions/checkout@v2
- uses: ./.github/actions/deploy-service
with:
service: search-sync-api
image: ${{ needs.build-and-push-search-sync-api.outputs.image }}
cluster: ${{ env.CROWD_CLUSTER }}
deploy-integration-sync-worker:
needs: build-and-push-integration-sync-worker
runs-on: ubuntu-latest
if: ${{ inputs.deploy_integration_sync_worker }}
defaults:
run:
shell: bash
steps:
- name: Check out repository code
uses: actions/checkout@v2
- uses: ./.github/actions/deploy-service
with:
service: integration-sync-worker
image: ${{ needs.build-and-push-integration-sync-worker.outputs.image }}
cluster: ${{ env.CROWD_CLUSTER }}
cloud_env: prod
prioritized: true
deploy-webhook-api:
needs: build-and-push-webhook-api
runs-on: ubuntu-latest
if: ${{ inputs.deploy_webhook_api }}
defaults:
run:
shell: bash
steps:
- name: Check out repository code
uses: actions/checkout@v2
- uses: ./.github/actions/deploy-service
with:
service: webhook-api
image: ${{ needs.build-and-push-webhook-api.outputs.image }}
cluster: ${{ env.CROWD_CLUSTER }}
deploy-automations-worker:
needs: build-and-push-automations-worker
runs-on: ubuntu-latest
if: ${{ inputs.deploy_automations_worker }}
defaults:
run:
shell: bash
steps:
- name: Check out repository code
uses: actions/checkout@v2
- uses: ./.github/actions/deploy-service
with:
service: automations-worker
image: ${{ needs.build-and-push-automations-worker.outputs.image }}
cluster: ${{ env.CROWD_CLUSTER }}
deploy-emails-worker:
needs: build-and-push-emails-worker
runs-on: ubuntu-latest
if: ${{ inputs.deploy_emails_worker }}
defaults:
run:
shell: bash
steps:
- name: Check out repository code
uses: actions/checkout@v2
- uses: ./.github/actions/deploy-service
with:
service: emails-worker
image: ${{ needs.build-and-push-emails-worker.outputs.image }}
cluster: ${{ env.CROWD_CLUSTER }}
deploy-script-executor:
needs: build-and-push-script-executor
runs-on: ubuntu-latest
if: ${{ inputs.deploy_script_executor }}
defaults:
run:
shell: bash
steps:
- name: Check out repository code
uses: actions/checkout@v2
- uses: ./.github/actions/deploy-service
with:
service: script-executor
image: ${{ needs.build-and-push-script-executor.outputs.image }}
cluster: ${{ env.CROWD_CLUSTER }}