This repository was archived by the owner on Feb 19, 2026. It is now read-only.
Repository navigation
fix(controller): register v1beta1 scheme, sync AccessPolicy CRD, demo… #20
This file contains hidden or 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] | |
| paths: | |
| - "cmd/**" | |
| - "api/**" | |
| - "internal/**" | |
| - "config/**" | |
| - "go.mod" | |
| - "go.sum" | |
| - "Dockerfile" | |
| - ".github/workflows/ci.yml" | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - "cmd/**" | |
| - "api/**" | |
| - "internal/**" | |
| - "config/**" | |
| - "go.mod" | |
| - "go.sum" | |
| - "Dockerfile" | |
| - ".github/workflows/ci.yml" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| GOLANGCI_VERSION: "v2.8.0" | |
| jobs: | |
| lint: | |
| runs-on: blacksmith-4vcpu-ubuntu-2404 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: "go.mod" | |
| - uses: golangci/golangci-lint-action@v9 | |
| with: | |
| version: ${{ env.GOLANGCI_VERSION }} | |
| build: | |
| runs-on: blacksmith-4vcpu-ubuntu-2404 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: "go.mod" | |
| - name: Generate | |
| run: | | |
| go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.20.0 | |
| controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..." | |
| controller-gen rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases | |
| - name: Build binary | |
| run: | | |
| VERSION=$(git describe --tags --abbrev=0 2>/dev/null || echo "0.0.0") | |
| VERSION="${VERSION#v}-ci+$(git rev-parse --short HEAD)" | |
| CGO_ENABLED=0 go build -trimpath -ldflags "-s -w \ | |
| -X main.Version=${VERSION} \ | |
| -X main.Commit=$(git rev-parse --short HEAD) \ | |
| -X main.BuildDate=$(date -u +%Y-%m-%dT%H:%M:%SZ)" \ | |
| -o bin/manager ./cmd/manager | |
| - name: Build image | |
| run: | | |
| VERSION=$(git describe --tags --abbrev=0 2>/dev/null || echo "0.0.0") | |
| VERSION="${VERSION#v}-ci+$(git rev-parse --short HEAD)" | |
| docker build \ | |
| --build-arg VERSION="${VERSION}" \ | |
| --build-arg COMMIT=$(git rev-parse --short HEAD) \ | |
| --build-arg BUILD_DATE=$(date -u +%Y-%m-%dT%H:%M:%SZ) \ | |
| -t cfgate:ci . |