File tree Expand file tree Collapse file tree 1 file changed +21
-10
lines changed Expand file tree Collapse file tree 1 file changed +21
-10
lines changed Original file line number Diff line number Diff line change @@ -2,29 +2,40 @@ name: Deploy Production
22
33on :
44 push :
5- tags : ['v*.*.*'] # semantic- version tag triggers
5+ tags : ['v*.*.*'] # Trigger on semantic version tags
66
77jobs :
88 promote :
99 runs-on : ubuntu-latest
1010 environment : production
1111
1212 steps :
13- - name : Pull exact containers built for same commit
14- run : |
15- docker pull ghcr.io/${{ github.repository }}:staging
16- docker tag ghcr.io/${{ github.repository }}:staging ghcr.io/${{ github.repository }}:prod
13+ - name : Checkout repo
14+ uses : actions/checkout@v4
1715
18- - name : Push prod tag
19- run : docker push ghcr.io/${{ github.repository }}:prod
16+ - name : Set up Node.js
17+ uses : actions/setup-node@v4
18+ with :
19+ node-version : 20
20+
21+ - name : Install dependencies
22+ run : npm ci
23+
24+ - name : Build Docker image
25+ uses : docker/build-push-action@v5
26+ with :
27+ context : ./backend
28+ push : true
29+ tags : ghcr.io/${{ github.repository }}:prod
2030
21- - name : ECS update service
31+ # Alternative: Use ECS deploy if beanstalk deploy is missing
32+ - name : Deploy to Elastic Beanstalk (alternative)
2233 uses : aws-actions/amazon-ecs-deploy-task-definition@v1
2334 with :
24- task-definition : backend/taskdef.json # checked-in file
35+ task-definition : backend/taskdef.json # Define your task definition here
2536 service : ai-eyes-prod
2637 cluster : ai-eyes
2738 wait-for-service-stability : true
28- aws-access-key-id : ${{ secrets.AWS_ACCESS_KEY_ID }}
39+ aws-access-key-id : ${{ secrets.AWS_ACCESS_KEY_ID }}
2940 aws-secret-access-key : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
3041 aws-region : us-east-1
You can’t perform that action at this time.
0 commit comments