Merge pull request #76 from ca-gip/1.34_dev #109
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: build-test-push-to-test-registry | |
| on: | |
| push: | |
| branches: | |
| - '**' | |
| pull_request: | |
| env: | |
| REGISTRY: ghcr.io | |
| jobs: | |
| build-test: | |
| name: Build and test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Find current tag version | |
| run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
| id: tags | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.25' | |
| - uses: azure/setup-helm@v4.3.0 | |
| id: install | |
| - name: Install helm plugin helm-images | |
| run: helm plugin install --verify=false https://github.com/nikhilsbhat/helm-images | |
| - name: Install GoReleaser | |
| uses: goreleaser/goreleaser-action@v6 | |
| with: | |
| install-only: true | |
| - name: install cfssl | |
| run: go install github.com/cloudflare/cfssl/cmd/...@latest | |
| - name: run non-E2E tests | |
| run: make test | |
| - name: run E2E test | |
| run: make test-e2e | |
| push-test-registry: | |
| name: Push images on a test registry | |
| runs-on: ubuntu-latest | |
| needs: build-test | |
| strategy: | |
| matrix: | |
| component: [webhook, api, operator] | |
| arch: [amd64] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Find current tag version | |
| run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
| id: tags | |
| - uses: goreleaser/goreleaser-action@v6 | |
| with: | |
| distribution: goreleaser | |
| version: v2.5.0 | |
| args: release --snapshot --clean | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| ORG: ${{ github.REPOSITORY_OWNER }} | |
| - name: Login to container registry | |
| # Pull requests are targetting ca-gip/kubi and should not push an image | |
| # Only push images for the fork's repository | |
| if: github.event_name != 'pull_request' | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Push development image into ghcr (packages) | |
| # Pull requests are targetting ca-gip/kubi and should not push an image | |
| # Only push images for the fork's repository | |
| if: github.event_name != 'pull_request' | |
| run: | | |
| docker push ${{ env.REGISTRY }}/${{ github.REPOSITORY_OWNER }}/kubi-${{ matrix.component }}:${{ steps.tags.outputs.sha_short }}-${{ matrix.arch }} |