Skip to content

Commit

Permalink
ga: upgrade: check for rollback
Browse files Browse the repository at this point in the history
  • Loading branch information
akirillo committed Feb 9, 2024
1 parent 4990283 commit 137f5a2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
build-and-push-ecr:
runs-on: buildjet-8vcpu-ubuntu-2204-arm
outputs:
image: ${{ steps.login-ecr.outputs.registry }}/renegade-${{ github.ref_name }}
image: ${{ steps.login-ecr.outputs.registry }}/renegade-${{ github.ref_name }}:${{ github.sha }}
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -96,9 +96,20 @@ jobs:
image: ${{ needs.build-and-push-ecr.outputs.image }}

- name: Deploy Amazon ECS task definition
id: ecs-deploy
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: ${{ steps.update-task-def.outputs.task-definition }}
service: ${{ matrix.cluster }}-service
cluster: ${{ matrix.cluster }}
wait-for-service-stability: true

- name: Check for rollback
id: check-rollback
run: |
CURRENT_TASK_DEF_ARN=$(aws ecs describe-services --cluster ${{ matrix.cluster }} --services ${{ matrix.cluster }}-service --query services[0].deployments[0].taskDefinition | jq -r ".")
NEW_TASK_DEF_ARN=${{ steps.ecs-deploy.outputs.task-definition-arn }}
if [ "$CURRENT_TASK_DEF_ARN" != "$NEW_TASK_DEF_ARN" ]; then
echo "Deployment rolled back."
exit 1
fi
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly-2023-08-19
nightly-2023-12-08

0 comments on commit 137f5a2

Please sign in to comment.