Skip to content

build(deps): bump github.com/aiven/go-client-codegen #1299

build(deps): bump github.com/aiven/go-client-codegen

build(deps): bump github.com/aiven/go-client-codegen #1299

Workflow file for this run

name: Build and deploy Kafkarator
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
paths-ignore:
- doc/**
- examples/**
- scripts/**
- dashboards/**
env:
GOOGLE_REGISTRY: europe-north1-docker.pkg.dev
FEATURE_REGISTRY: europe-north1-docker.pkg.dev/nais-io/nais/feature
jobs:
version:
name: Set variables
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # ratchet:actions/checkout@v6
- name: "Set image version"
id: constants
run: |
export version="$(date +%Y%m%d%H%M%S)-$(git describe --always --dirty --exclude '*')"
echo "VERSION=${version}" >> ${GITHUB_OUTPUT}
outputs:
version: "${{ steps.constants.outputs.VERSION }}"
test_validate:
name: Test and Validate
runs-on: ubuntu-latest
needs:
- version
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # ratchet:actions/checkout@v6
- name: Setup Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # ratchet:actions/setup-go@v6
with:
go-version-file: "go.mod"
cache: true
cache-dependency-path: |
go.sum
**/go.sum
- name: Setup mise
uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # ratchet:jdx/mise-action@v4
- name: Trust mise config
run: mise trust
- name: Run tests
run: mise run test
- name: Run checks
run: mise run check
build:
name: Build and push
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
needs:
- test_validate
- version
strategy:
fail-fast: false
matrix:
target:
- kafkarator
- canary
- canary-deployer
env:
VERSION: "${{ needs.version.outputs.VERSION }}"
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # ratchet:actions/checkout@v6
- uses: nais/platform-build-push-sign@df590279b21bc5978519685752f9eaddd546043c # ratchet:nais/platform-build-push-sign@main
with:
name: kafkarator/${{ matrix.target }}
dockerfile: Dockerfile.${{ matrix.target }}
google_service_account: gh-kafkarator
workload_identity_provider: ${{ secrets.NAIS_IO_WORKLOAD_IDENTITY_PROVIDER }}
push: ${{ github.ref == 'refs/heads/master' }}
extra_tags: ${{ needs.version.outputs.VERSION }}
chart:
permissions:
contents: 'read'
id-token: 'write'
name: Build and push chart
runs-on: ubuntu-latest
needs:
- version
- test_validate
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # ratchet:actions/checkout@v6
- id: 'auth'
name: 'Authenticate to Google Cloud'
if: github.ref == 'refs/heads/master'
uses: 'google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093' # ratchet:google-github-actions/auth@v3
with:
workload_identity_provider: ${{ secrets.NAIS_IO_WORKLOAD_IDENTITY_PROVIDER }}
service_account: 'gh-kafkarator@nais-io.iam.gserviceaccount.com'
token_format: 'access_token'
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@aa5489c8933f4cc7a4f7d45035b3b1440c9c10db' # ratchet:google-github-actions/setup-gcloud@v3
- name: 'Log in to Google Artifact Registry'
if: github.ref == 'refs/heads/master'
run: |-
echo '${{ steps.auth.outputs.access_token }}' | docker login -u oauth2accesstoken --password-stdin https://${{ env.GOOGLE_REGISTRY }}
- uses: azure/setup-helm@dda3372f752e03dde6b3237bc9431cdc2f7a02a2 # ratchet:azure/setup-helm@v5
name: 'Setup Helm'
- name: Set versions
run: |-
for chart in charts/*; do
yq e '.version = "${{ needs.version.outputs.VERSION }}"' --inplace "${chart}/Chart.yaml"
yq e '.image.tag = "${{ needs.version.outputs.VERSION }}"' --inplace "${chart}/values.yaml"
yq e '.canary.image.tag = "${{ needs.version.outputs.VERSION }}"' --inplace "${chart}/values.yaml"
yq e '.deployer.image.tag = "${{ needs.version.outputs.VERSION }}"' --inplace "${chart}/values.yaml"
done
- name: Build Chart
run: |-
for chart in charts/*; do
helm package "$chart"
done
- name: Push Chart
if: github.ref == 'refs/heads/master'
run: |-
for chart in *.tgz; do
helm push "$chart" oci://${{ env.FEATURE_REGISTRY }}
done
deploy:
name: Deploy
if: github.actor != 'dependabot[bot]' && github.ref == 'refs/heads/master'
needs:
- build
- chart
- version
runs-on: fasit-deploy
permissions:
id-token: write
strategy:
fail-fast: false
matrix:
feature:
- name: kafkarator
targets: |
[
{ "target": { "kafka": "enabled", "kind": "tenant", "tenant": "ci-nais" }, "wait": true },
{ "target": { "kafka": "enabled", "kind": "tenant" } }
]
- name: kafka-canary
targets: |
[
{ "target": { "kafka": "enabled", "kind": "management", "tenant": "ci-nais" }, "wait": true },
{ "target": { "kafka": "enabled", "kind": "management" } }
]
- name: kafka-canary-alert
targets: |
[
{ "target": { "kafka": "enabled", "kind": "tenant", "tenant": "ci-nais" }, "wait": true },
{ "target": { "kafka": "enabled", "kind": "tenant" } }
]
steps:
- uses: nais/fasit-deploy@97187355184a7f0f4b7a36a2b49a86ce02240f7b # ratchet:nais/fasit-deploy@v4.0.0
with:
chart: oci://${{ env.FEATURE_REGISTRY }}/${{ matrix.feature.name }}
version: ${{ needs.version.outputs.VERSION }}
targets: ${{ matrix.feature.targets }}