Skip to content

Commit

Permalink
Merge pull request #198 from jbrunton/refactor-deployments
Browse files Browse the repository at this point in the history
feat: remove ecs deployment step
  • Loading branch information
jbrunton authored Sep 8, 2024
2 parents aa443db + 47894f1 commit 476738e
Showing 1 changed file with 0 additions and 43 deletions.
43 changes: 0 additions & 43 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ jobs:
needs: [build-api]
runs-on: ubuntu-latest
steps:
- run: |
echo "CURRENT_TASK_DEFINITION=${{ runner.temp }}/currentTaskDefinition.json" >> $GITHUB_ENV
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4

Expand Down Expand Up @@ -67,44 +65,3 @@ jobs:
AWS_REGION: us-east-1
API_TAG: ${{ needs.build-api.outputs.tag }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Get pulumi outputs
id: pulumi-outputs
run: |
pulumi stack select ${{ github.head_ref || github.ref_name }}
echo "cluster=$(pulumi stack output cluster)" > $GITHUB_OUTPUT
echo "service=$(pulumi stack output apiService)" > $GITHUB_OUTPUT
echo "taskDefinitionArn=$(pulumi stack output apiTaskDefinitionArn)" > $GITHUB_OUTPUT
working-directory: pulumi
env:
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}

- name: Get current task definition
id: current-task-def
run: |
export TASK_DEFINITION_FILE=${{ runner.temp }}/taskDefinition.json
aws ecs describe-task-definition --task-definition $TASK_DEFINITION_ARN \
--query taskDefinition --output json \
| jq 'del(.revision, .compatibilities, .taskDefinitionArn, .requiresAttributes, .status, .registeredAt, .registeredBy)' \
> $TASK_DEFINITION_FILE
echo "taskDefinitionFile=$TASK_DEFINITION_FILE" > $GITHUB_OUTPUT
env:
TASK_DEFINITION_ARN: ${{ steps.pulumi-outputs.outputs.taskDefinitionArn }}
working-directory: pulumi

- name: Render new task definition
id: new-task-def
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: ${{ steps.current-task-def.outputs.taskDefinitionFile }}
container-name: chat-demo-api
image: ${{ needs.build-api.outputs.tag }}

- name: Deploy Amazon ECS task definition
uses: aws-actions/amazon-ecs-deploy-task-definition@v2
with:
task-definition: ${{ steps.new-task-def.outputs.task-definition }}
service: ${{ steps.pulumi-outputs.outputs.service }}
cluster: ${{ steps.pulumi-outputs.outputs.cluster }}
wait-for-service-stability: true
wait-for-task-stopped: true

0 comments on commit 476738e

Please sign in to comment.