Skip to content

Githubcicheck

Githubcicheck #261

Workflow file for this run

# ci for product catalog service

Check failure on line 1 in .github/workflows/ci.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/ci.yaml

Invalid workflow file

(Line: 21, Col: 13): Unexpected value 'go-version:1.23.x'
name: product-catalog.ci
on:
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v4
- name: Setup Go 1.23.x
uses: actions/setup-go@v4
with:
go-version:1.23.x
- name: Build
run:
cd src/product-catalog
go mod download
go build -o product-catalog-service src/product-catalog/main.go
- name: unit tests
run:
cd src/product-catalog
go mod download
go test src/product-catalog/...
code-quality:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v4
- name: Run golangcci-lint
run:
go install github.com/golangci/golangci-lint/cmd/[email protected]
golangci-lint run src/product-catalog/...
docker:
runs-on: ubuntu-latest
needs: Build
steps:
- name: checkout code
uses: actions/checkout@v4
- name: Install docker
uses: docker/setup-buildx-action@v1
- name: Login to docker
uses: docker/login-action@v3
with:
username: ${{secrets.DOCKER_USERNAME}}
password: ${{secrets.DOCKER_TOKEN}}
- name: Docker Push
uses: docker/build-push-action@v6
with:
context: src/product-catalog
file: Dockerfile
push: true
tags: ${{secrets.DOCKER_USERNAME}}/product-catalog-service:${{github.run_id}}
updatek8:
runs-on: ubuntu-latest
needs: docker
steps:
- name: checkout code
uses: actions/checkout@v4
with:
token: ${{secrets.GITHUB_TOKEN}}
- 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
- name: commit and push changes
run: |
git config --global user.email "[email protected]"
git config --global user.name "shahipranav"
git add kubernetes/productcatalog/deploy.yaml
git commit -m "[CI]: update product catalog image tag"
git push