File tree Expand file tree Collapse file tree 1 file changed +46
-1
lines changed
Expand file tree Collapse file tree 1 file changed +46
-1
lines changed Original file line number Diff line number Diff line change 5353 flake8 . --max-line-length=100 --exclude=demo_pb2.py,demo_pb2_grpc.py,venv
5454 continue-on-error : true
5555
56-
56+ build-and-push :
57+ runs-on : ubuntu-latest
58+ needs : [unit-testing, code-quality]
59+ steps :
60+ - name : Checkout code
61+ uses : actions/checkout@v4
62+
63+ - name : Install Docker
64+ uses : docker/setup-buildx-action@v1
65+
66+ - name : Login to Docker
67+ uses : docker/login-action@v2
68+ with :
69+ username : ${{ secrets.DOCKER_USERNAME }}
70+ password : ${{ secrets.DOCKER_PASSWORD }}
71+
72+ - name : Build and push Docker image
73+ uses : docker/build-push-action@v3
74+ with :
75+ context : .
76+ file : ./src/recommendation/Dockerfile
77+
78+ push : true
79+ tags : neamulkabiremon/recommendation:${{ github.sha }}
80+
81+ update-k8s-deployment :
82+ runs-on : ubuntu-latest
83+ needs : build-and-push
84+ steps :
85+ - name : Checkout code
86+ uses : actions/checkout@v4
87+ with :
88+ token : ${{ secrets.GITHUB_TOKEN }}
89+
90+ - name : Update Kubernetes Deployment
91+ run : |
92+ sed -i "s|image: .*|image: ${{ secrets.DOCKER_USERNAME }}/recommendation:${{ github.sha }}|" kubernetes/recommendation/deploy.yaml
93+ cat kubernetes/recommendation/deploy.yaml
94+
95+ - name : Commit and push updated Kubernetes manifest
96+ run : |
97+ git config --global user.email "neamulkabiremon@gmail.com"
98+ git config --global user.name "neamulkabiremon"
99+ git add kubernetes/recommendation/deploy.yaml
100+ git commit -m "[CI]: Update checkout deployment image tag"
101+ git push
You can’t perform that action at this time.
0 commit comments