Skip to content

Re-lint

Re-lint #9

Workflow file for this run

name: Main workflow
on:
pull_request:
paths:
- '**'
push:
branches:
- main
paths:
- '**'
jobs:
lint-and-test:
name: Lint and test code and charts
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
cache: true
cache-dependency-path: go.sum
- name: Run tests
run: |
make test
make integration-test
- name: Install Helm
uses: azure/setup-helm@v4
- name: Lint Helm charts
run: |
helm lint kubenetmon/deploy/helm
- name: Test Helm charts
run: |
helm template kubenetmon/deploy/helm | kubectl apply --dry-run=client -f -
build-and-publish:
name: Build and publish Docker image and Helm chart
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: lint-and-test
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Build Docker image
run: |
docker build -t your-docker-repo/kubenetmon:${{ github.sha }} .
- name: Push Docker image
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ secrets.GITHUB_ACTOR }}
password: ${{ secrets.GITHUB_TOKEN }}
- run: |
docker push your-docker-repo/kubenetmon:${{ github.sha }}
- name: Package Helm chart
run: |
helm package kubenetmon/deploy/helm
- name: Publish Helm chart
uses: helm/[email protected]
with:
charts_dir: kubenetmon/deploy/helm
release_repo: your-helm-repo-url