ci: add helm chart #664
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: Build wonderwall | |
on: [push] | |
env: | |
GOOGLE_REGISTRY: europe-north1-docker.pkg.dev | |
GITHUB_REGISTRY: ghcr.io | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout latest code | |
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # ratchet:actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # ratchet:actions/setup-go@v4 | |
with: | |
go-version: "1.21" | |
check-latest: true | |
- name: Test Go | |
run: | | |
make test | |
make check | |
build: | |
needs: test | |
name: Publish to Google and GitHub registries | |
if: github.ref == 'refs/heads/master' | |
permissions: | |
contents: "read" | |
id-token: "write" | |
packages: "write" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # ratchet:actions/checkout@v4 | |
- name: Install cosign | |
uses: sigstore/cosign-installer@1fc5bd396d372bee37d608f955b336615edf79c8 # ratchet:sigstore/cosign-installer@main | |
with: | |
cosign-release: 'v2.2.1' | |
- name: Verify runner image | |
run: cosign verify --certificate-oidc-issuer https://accounts.google.com --certificate-identity keyless@distroless.iam.gserviceaccount.com gcr.io/distroless/static-debian11:nonroot | |
- uses: nais/platform-build-push-sign@main # ratchet:exclude | |
id: build_push_sign | |
with: | |
name: wonderwall | |
dockerfile: Dockerfile | |
google_service_account: gh-wonderwall | |
multi-platform: true | |
push: true | |
push_ghcr: true | |
workload_identity_provider: ${{ secrets.NAIS_IO_WORKLOAD_IDENTITY_PROVIDER }} | |
- uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # ratchet:azure/setup-helm@v3 | |
name: 'Setup Helm' | |
with: | |
version: '3.13.2' | |
- name: Set versions | |
run: |- | |
for chart in charts/*; do | |
yq e '.version = "${{ needs.build_push_sign.outputs.version }}"' --inplace "${chart}/Chart.yaml" | |
yq e '.image.tag = "${{ needs.build_push_sign.outputs.version }}"' --inplace "${chart}/values.yaml" | |
done | |
- name: Build Chart | |
run: |- | |
for chart in charts/*; do | |
helm package "$chart" | |
done | |
- name: Push Chart | |
run: |- | |
for chart in *.tgz; do | |
helm push "$chart" oci://${{ env.GOOGLE_REGISTRY }}/nais-io/nais/feature | |
done | |
outputs: | |
version: ${{ steps.build_push_sign.outputs.version }} | |
rollout: | |
name: Rollout | |
if: github.actor != 'dependabot[bot]' && github.ref == 'refs/heads/master' | |
needs: build | |
runs-on: fasit-deploy | |
permissions: | |
id-token: write | |
steps: | |
- uses: nais/fasit-deploy@v2 # ratchet:exclude | |
with: | |
chart: oci://${{ env.GOOGLE_REGISTRY }}/nais-io/nais/feature/wonderwall | |
version: ${{ needs.build.outputs.version }} |