forked from chatwoot/chatwoot
-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (62 loc) · 2.21 KB
/
Copy pathdeploy.yml
File metadata and controls
72 lines (62 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Deploy to ECS
on:
workflow_dispatch:
inputs:
environment:
description: 'Environment to deploy to'
required: true
default: 'production'
type: choice
options:
- production
jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/Dockerfile
platforms: linux/amd64
push: true
tags: 340752842719.dkr.ecr.us-east-1.amazonaws.com/chatwoot-p4d-fork:latest
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Force new ECS deployment
run: |
echo "Forcing new deployment for chatwoot-production-web..."
aws ecs update-service \
--cluster chatwoot-production-cluster \
--service chatwoot-production-web \
--force-new-deployment
- name: Wait for deployment to complete
run: |
echo "Waiting for deployment to stabilize..."
aws ecs wait services-stable \
--cluster chatwoot-production-cluster \
--services chatwoot-production-web
- name: Get deployment status
run: |
echo "✅ Deployment completed successfully!"
echo ""
echo "Service status:"
aws ecs describe-services \
--cluster chatwoot-production-cluster \
--services chatwoot-production-web \
--query 'services[0].deployments[*].{status:status,desiredCount:desiredCount,runningCount:runningCount,taskDefinition:taskDefinition}' \
--output table