Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove ecs deployment step #198

Merged
merged 1 commit into from
Sep 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading