Skip to content

Deploy Mock Warden to USE1 - STAGE #1

Deploy Mock Warden to USE1 - STAGE

Deploy Mock Warden to USE1 - STAGE #1

name: Deploy Mock Warden to USE1 - STAGE
# Controls when the action will run. Invokes the workflow only on dispatch (manually)
on: [ workflow_dispatch ]
env:
#region used to authenticate (IAM role), not related to deployment since deployment logic is contained in the Make file
AWS_IAM_AUTH_REGION : "us-east-1"
APP : "mock-warden"
CHANNEL : "mock-warden-infra"
ENV : "dev"
TIER : "use1"
REGION : "us-east-1"
#ECS
ECR_REPO : "963800667800.dkr.ecr.us-east-2.amazonaws.com"
# Permission can be added at job level or workflow level
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
jobs:
build-and-deploy-ecs:
environment: use1-stage
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get version
id: version
uses: ./.github/actions/get-version
- name: Build and push to ECR
uses: ./.github/actions/build-and-push-docker
with:
ecr_repo: ${{ env.ECR_REPO }}
image_tag: ${{ steps.get-version.outputs.tag }}
server_name: ${{ env.APP }}
dockerfile: ./Dockerfile
# - name: Build task definition
# uses: ./.github/actions/build-task-definition
# id: build-task-definition
# with:
# working_directory: ./infra
# image_tag: ${{ steps.get-version.outputs.tag }}
# github_user: ${{ secrets.A_GH_USER }}
# github_token: ${{ secrets.A_GH_TOKEN }}
# environment: ${{ env.ENV }}
# tier: ${{ env.TIER }}
# region: ${{ env.REGION }}
# aws_role_to_assume: arn:aws:iam::708050157146:role/github_eb_ci_cd
# - name: Deploy to ECS
# uses: ./.github/actions/deploy
# with:
# task_definition_version: ${{ steps.build-task-definition.outputs.task_definition_version }}
# service_name: ${{ env.APP }}
# region: ${{ env.REGION }}
# environment: ${{ env.ENV }}
# - name: Slack Notification
# if: ${{ !cancelled() }}
# uses: rtCamp/action-slack-notify@v2
# env:
# SLACK_CHANNEL: ${{ env.CHANNEL }}
# SLACK_COLOR: ${{ job.status }} # or a specific color like 'good' or '#ff00ff'
# SLACK_MESSAGE: '${{ vars.ENV }} ${{ env.APP }} Deployed to ${{ vars.NAME }} ${{ steps.get-version.outputs.tag }} : ${{ job.status }} '
# SLACK_TITLE: Status
# SLACK_USERNAME: Deployer
# SLACK_WEBHOOK: ${{ secrets.CI_CD_WEBHOOK }}