Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@

name: product-catalog-ci


on:
pull_request:
push:
branches:
- githubcicheck
pull_request:
branches:
- main
- githubcicheck

jobs:
build:
Expand Down Expand Up @@ -47,7 +51,6 @@ jobs:
uses: golangci/golangci-lint-action@v6
with:
version: v1.55.2
run: golangci-lint run
working-directory: src/product-catalog

docker:
Expand All @@ -59,13 +62,13 @@ jobs:
- name: checkout code
uses: actions/checkout@v4

- name: Install Docker
uses: docker/setup-buildx-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
username: ${{ secrets.DOCKER_USER_NAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Docker Push
Expand All @@ -74,7 +77,7 @@ jobs:
context: src/product-catalog
file: src/product-catalog/Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/product-catalog:${{github.run_id}}
tags: ravichandra451/product-catalog:${{github.run_id}}


updatek8s:
Expand All @@ -90,12 +93,12 @@ jobs:

- name: Update tag in kubernetes deployment manifest
run: |
sed -i "s|image: .*|image: ${{ secrets.DOCKER_USERNAME }}/product-catalog:${{github.run_id}}|" kubernetes/productcatalog/deploy.yaml
sed -i "s|image: .*|image: ${{ secrets.DOCKER_USER_NAME }}/product-catalog:${{github.run_id}}|" kubernetes/productcatalog/deploy.yaml

- name: Commit and push changes
run: |
git config --global user.email "abhishek@gmail.com"
git config --global user.name "Abhishek Veeramalla"
git config --global user.email "ravicahndram798@gmail.com"
git config --global user.name "Ravichandra"
git add kubernetes/productcatalog/deploy.yaml
git commit -m "[CI]: Update product catalog image tag"
git push origin HEAD:main -f
Expand Down
Loading