Merge pull request #299 from winrouter/main #451
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- 'main' | |
pull_request: | |
branches: | |
- 'main' | |
jobs: | |
build-test: | |
name: build-test | |
runs-on: ubuntu-latest | |
if: github.repository == 'kubesphere/kubeeye' | |
env: | |
GO111MODULE: on | |
steps: | |
- name: Set up Go 1.17 | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.17 | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Downloading go dependencies | |
run: go mod tidy | |
- name: sync the vendor directory | |
run: go mod vendor | |
- name: Build command-line tool | |
run: go install -v ./cmd/... | |
- name: Creating kind cluster | |
uses: helm/[email protected] | |
- name: Run KubeEye | |
run: | | |
ke audit | |
push-image-to-dockerhub: | |
runs-on: ubuntu-latest | |
needs: [build-test] | |
if: github.event_name == 'push' | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
with: | |
platforms: all | |
- name: Set up Docker buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- name: Push image | |
run: | | |
REPO=kubesphere make container-cross-push |