deploy-gf dev #3
Workflow file for this run
This file contains hidden or 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: Deploy contracts GF | ||
run-name: deploy-gf ${{ inputs.environment }} | ||
on: | ||
workflow_call: | ||
inputs: | ||
environment: | ||
required: true | ||
type: string | ||
tag_suffix: | ||
required: true | ||
type: string | ||
workflow_dispatch: | ||
inputs: | ||
environment: | ||
description: AB2D environment | ||
required: true | ||
type: choice | ||
options: | ||
- dev | ||
- test | ||
- sandbox | ||
- prod | ||
image_tag_suffix: | ||
description: Image tag suffix | ||
required: true | ||
type: string | ||
jobs: | ||
apply_tofu: | ||
uses: cmsgov/ab2d/.github/workflows/terraform-microservices-gf.yml@gf-test--burling/ab2d-6692 | ||
Check failure on line 31 in .github/workflows/deploy-gf.yml
|
||
with: | ||
contracts_service_image: contract-service-${{ inputs.image_tag_suffix }} | ||
deploy: | ||
permissions: | ||
contents: read | ||
id-token: write | ||
runs-on: codebuild-ab2d-contracts-${{github.run_id}}-${{github.run_attempt}} | ||
env: | ||
AWS_ACCOUNT: ${{contains(fromJSON('["dev", "test"]'), inputs.environment) && secrets.GF_NON_PROD_ACCOUNT || secrets.GF_PROD_ACCOUNT}} | ||
AB2D_ENV: ${{ inputs.environment }} | ||
steps: | ||
- uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2 | ||
with: | ||
aws-region: ${{ vars.AWS_REGION }} | ||
role-to-assume: arn:aws:iam::${{ env.AWS_ACCOUNT }}:role/delegatedadmin/developer/ab2d-${{ env.AB2D_ENV }}-github-actions | ||
- name: Run tofu apply | ||
env: | ||
ECS_FAMILY_PREFIX: ab2d-dev-contracts-service-task-definition | ||
run: | | ||
TASK_DEF=$(aws ecs list-task-definitions --family-prefix $ECS_FAMILY_PREFIX --query "taskDefinitionArns[0]" | tr -d '"') | ||
echo "task definition=$TASK_DEF" | ||
# - name: Deploy ECS service to run on latest image in ECR | ||
# env: | ||
# DEPLOYMENT_ENV: ab2d-${{ env.AB2D_ENV }}-microservice-cluster | ||
# run: | | ||
# echo "Deploying contracts service" | ||
# aws ecs update-service --cluster "$DEPLOYMENT_ENV" --service ab2d-contracts-service --force-new-deployment > /dev/null | ||
# aws ecs wait services-stable --cluster "$DEPLOYMENT_ENV" --services ab2d-contracts-service |