File tree Expand file tree Collapse file tree 1 file changed +16
-26
lines changed Expand file tree Collapse file tree 1 file changed +16
-26
lines changed Original file line number Diff line number Diff line change 1- name : Deploy to Elastic Beanstalk
1+ name : Deploy React Client (Production)
22
33on :
44 push :
5- tags : ['v*.*.*'] # Trigger deployment on semantic version tags (e.g., v1.0.0)
5+ tags :
6+ - ' v*.*.*'
67
78jobs :
8- deploy :
9+ build-and- deploy :
910 runs-on : ubuntu-latest
10-
1111 steps :
12- - name : Checkout code
13- uses : actions/checkout@v4
12+ - uses : actions/checkout@v4
1413
15- - name : Set up Node.js
16- uses : actions/setup-node@v4
14+ - uses : actions/setup-node@v4
1715 with :
18- node-version : ' 20 '
16+ node-version : ' 18 '
1917
2018 - name : Install dependencies
19+ working-directory : client
2120 run : npm ci
2221
23- - name : Build Docker image
24- uses : docker/build-push-action@v5
25- with :
26- context : ./backend
27- push : true
28- tags : ghcr.io/${{ github.repository }}:prod
22+ - name : Build client
23+ working-directory : client
24+ run : npm run build
2925
30- # Alternative: Use ECS deploy if beanstalk deploy is missing
31- - name : Deploy to AWS Elastic Beanstalk (or ECS)
32- uses : aws-actions/amazon-ecs-deploy-task-definition@v1
26+ - name : Deploy to GitHub Pages
27+ uses : JamesIves/github-pages-deploy-action@v4
3328 with :
34- cluster : ai-eyes
35- service : ai-eyes-prod
36- task-definition : backend/taskdef.json # Ensure your task definition is correct
37- wait-for-service-stability : true
38- aws-region : us-east-1
39- env :
40- AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
41- AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
29+ branch : gh-pages
30+ folder : client/build
31+ token : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments