refactor: remove jitter from exponential backoff in IAM operations #243
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 and push image and chart | |
| on: | |
| push: | |
| branches: | |
| - main | |
| env: | |
| NAME: nais-api-reconcilers | |
| IMAGE_REPOSITORY: oci://europe-north1-docker.pkg.dev/nais-io/nais | |
| jobs: | |
| version-info: | |
| outputs: | |
| go-version: ${{ steps.go-version.outputs.version }} | |
| name: Get version info | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: jdx/mise-action@v3 | |
| with: | |
| cache: false | |
| - id: go-version | |
| run: echo "version=$(mise current go)" >> $GITHUB_OUTPUT | |
| check: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| mise-task: | |
| - test | |
| - check:deadcode | |
| - check:gosec | |
| - check:helm-lint | |
| - check:staticcheck | |
| - check:govulncheck | |
| - check:govet | |
| - fmt:ci | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: jdx/mise-action@v3 | |
| with: | |
| cache: false | |
| - run: mise run ${{ matrix.mise-task }} | |
| build-push: | |
| needs: | |
| - version-info | |
| - check | |
| outputs: | |
| chart-version: ${{ steps.package-chart.outputs.version }} | |
| permissions: | |
| contents: read | |
| id-token: write | |
| name: Build and push | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: jdx/mise-action@v3 | |
| with: | |
| cache: false | |
| - uses: nais/platform-build-push-sign@main | |
| id: build-push-sign | |
| with: | |
| name: ${{ env.NAME }} | |
| build_args: | | |
| GO_VERSION=${{ needs.version-info.outputs.go-version }}- | |
| google_service_account: gh-api-reconcilers | |
| workload_identity_provider: ${{ secrets.NAIS_IO_WORKLOAD_IDENTITY_PROVIDER }} | |
| push: true | |
| - name: Package chart | |
| id: package-chart | |
| env: | |
| CHART_PATH: ./charts | |
| run: | | |
| base_version="$(yq '.version' < "${{ env.CHART_PATH }}/Chart.yaml")" | |
| chart_version="${base_version}-${{ steps.build-push-sign.outputs.version }}" | |
| yq eval \ | |
| '.version="'"$chart_version"'"' \ | |
| "${{ env.CHART_PATH }}/Chart.yaml" --inplace | |
| yq eval \ | |
| '.image.tag="${{ steps.build-push-sign.outputs.version }}"' \ | |
| "${{ env.CHART_PATH }}/values.yaml" --inplace | |
| helm package "${{ env.CHART_PATH }}" --destination . | |
| name=$(yq '.name' < "${{ env.CHART_PATH }}/Chart.yaml") | |
| echo "name=$name" >> $GITHUB_OUTPUT | |
| echo "version=$chart_version" >> $GITHUB_OUTPUT | |
| echo "archive=$name-$chart_version.tgz" >> $GITHUB_OUTPUT | |
| - name: Push Chart | |
| if: github.ref == 'refs/heads/main' | |
| run: |- | |
| chart="${{ steps.package-chart.outputs.archive }}" | |
| echo "Pushing: $chart" | |
| helm push "$chart" ${{ env.IMAGE_REPOSITORY }} | |
| rollout: | |
| runs-on: fasit-deploy | |
| permissions: | |
| id-token: write | |
| needs: | |
| - build-push | |
| steps: | |
| - uses: nais/fasit-deploy@v2 | |
| if: github.ref == 'refs/heads/main' | |
| with: | |
| chart: ${{ env.IMAGE_REPOSITORY }}/${{ env.NAME }} | |
| version: ${{ needs.build-push.outputs.chart-version }} |