Skip to content

Commit db50ed9

Browse files
Add full test coverage for ProductCatalogService & ESLint CI enforcement & docker build push and update deployment
1 parent 9fc14c6 commit db50ed9

File tree

1 file changed

+48
-1
lines changed

1 file changed

+48
-1
lines changed

.github/workflows/frontend.yaml

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,51 @@ jobs:
5454
- name: Run ESLint (code quality check)
5555
run: |
5656
cd src/frontend
57-
npm run lint -- --max-warnings=0 --quiet
57+
npm run lint -- --max-warnings=0 --quiet
58+
59+
build-and-push:
60+
runs-on: ubuntu-latest
61+
needs: [unit-testing, code-quality]
62+
steps:
63+
- name: Checkout code
64+
uses: actions/checkout@v4
65+
66+
- name: Install Docker
67+
uses: docker/setup-buildx-action@v1
68+
69+
- name: Login to Docker
70+
uses: docker/login-action@v2
71+
with:
72+
username: ${{ secrets.DOCKER_USERNAME }}
73+
password: ${{ secrets.DOCKER_PASSWORD }}
74+
75+
- name: Build and push Docker image
76+
uses: docker/build-push-action@v3
77+
with:
78+
context: .
79+
file: ./src/frontend/Dockerfile
80+
81+
push: true
82+
tags: neamulkabiremon/checkout:${{ github.sha }}
83+
84+
update-k8s-deployment:
85+
runs-on: ubuntu-latest
86+
needs: build-and-push
87+
steps:
88+
- name: Checkout code
89+
uses: actions/checkout@v4
90+
with:
91+
token: ${{ secrets.GITHUB_TOKEN }}
92+
93+
- name: Update Kubernetes Deployment
94+
run: |
95+
sed -i "s|image: .*|image: ${{ secrets.DOCKER_USERNAME }}/frontend:${{ github.sha }}|" kubernetes/frontend/deploy.yaml
96+
cat kubernetes/frontend/deploy.yaml
97+
98+
- name: Commit and push updated Kubernetes manifest
99+
run: |
100+
git config --global user.email "neamulkabiremon@gmail.com"
101+
git config --global user.name "neamulkabiremon"
102+
git add kubernetes/frontend/deploy.yaml
103+
git commit -m "[CI]: Update checkout deployment image tag"
104+
git push

0 commit comments

Comments
 (0)