Add workflow to build a image for each push on all branches except main #1
Workflow file for this run
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: Check pull request | |
on: | |
push: | |
branches-ignore: | |
- main | |
env: | |
NAME: nais-api-reconcilers | |
IMAGE_REPOSITORY: oci://europe-north1-docker.pkg.dev/nais-io/nais | |
jobs: | |
build_push: | |
permissions: | |
contents: read | |
id-token: write | |
name: Build and push | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- id: go_version | |
run: echo "go_version=$(cat .tool-versions | grep golang | awk '{print $2}')" >> $GITHUB_OUTPUT | |
- uses: nais/platform-build-push-sign@main | |
id: build-push-sign | |
with: | |
name: ${{ env.NAME }} | |
build_args: GO_VERSION=${{ steps.go_version.outputs.go_version }}- | |
google_service_account: gh-api-reconcilers | |
workload_identity_provider: ${{ secrets.NAIS_IO_WORKLOAD_IDENTITY_PROVIDER }} | |
push: true | |
- name: Build Chart | |
run: |- | |
sed -i "s/^version: .*/version: ${{ steps.build-push-sign.outputs.version }}/g" charts/Chart.yaml | |
cat charts/Chart.yaml | |
helm package charts | |
- name: Push Chart | |
run: |- | |
helm push ${{ env.NAME }}*.tgz ${{ env.IMAGE_REPOSITORY }} |