Skip to content

build(deps): bump actions/upload-artifact from 4.4.3 to 4.5.0 #177

build(deps): bump actions/upload-artifact from 4.4.3 to 4.5.0

build(deps): bump actions/upload-artifact from 4.4.3 to 4.5.0 #177

Workflow file for this run

name: Deploy to Amazon ECS (CR QA)
on:
workflow_dispatch: # Manually triggered from GitHub Actions tab
pull_request:
types: [labeled] # Triggered by a label in a PR
# Declare default permissions as read only.
permissions: read-all
env:
AWS_REGION: us-east-1
ECR_REPOSITORY: rscoll-dev-bim-qa
ECS_SERVICE: rscoll-dev-bim-qa
ECS_CLUSTER: rscoll-dev
ECS_TASK_DEFINITION: rscoll-dev-bim-qa
CONTAINER_NAME: rscoll-dev-bim-qa
# The .env file that is used to build the docker image
# is retrieved using PROFILE, so be sure there is a `.env.<PROFILE>` file
# that matches with the profile set
# Example: PROFILE=testnet => .env.testnet
PROFILE: testnet.qa
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
if: |
github.event_name == 'workflow_dispatch' || github.event.label.name == 'deploy to QA'
environment:
name: CR-QA
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 #v4.0.2
with:
role-to-assume: ${{ secrets.AWS_LOGIN_QA_ROLE_ARN }}
aws-region: ${{ env.AWS_REGION }}
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 #v2.0.1
- name: Build, tag, and push image to Amazon ECR
id: build-image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
IMAGE_TAG: ${{ github.sha }}
run: |
# Build a docker container and
# push it to ECR so that it can
# be deployed to ECS.
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG --build-arg PROFILE="$PROFILE" --build-arg NEXT_PUBLIC_BUILD_ID=${{ github.sha }} --no-cache .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG"
- name: Download task definition
run: aws ecs describe-task-definition --task-definition ${{ env.ECS_TASK_DEFINITION }} --query taskDefinition > task-definition.json
- name: Fill in the new image ID in the Amazon ECS task definition
id: task-def
uses: aws-actions/amazon-ecs-render-task-definition@469db592f4341616e992bf7f231e19b3ab9b4efa #v1.6.1
with:
task-definition: task-definition.json
container-name: ${{ env.CONTAINER_NAME }}
image: ${{ steps.build-image.outputs.image }}
- name: Deploy Amazon ECS task definition
uses: aws-actions/amazon-ecs-deploy-task-definition@0e82244a9c6dac43d70151a94c67ebc4bab18fc5 #v2.2.0
with:
task-definition: ${{ steps.task-def.outputs.task-definition }}
service: ${{ env.ECS_SERVICE }}
cluster: ${{ env.ECS_CLUSTER }}
wait-for-service-stability: true