Skip to content

Change the Dockerfile and Github workflow to support multiple platform builds #13

Change the Dockerfile and Github workflow to support multiple platform builds

Change the Dockerfile and Github workflow to support multiple platform builds #13

name: build and push to quay
on:
push:
tags:
- 'v*' # tags matching v*, i.e. v0.0.1, v1.0.0-rc.0
pull_request:
branches:
- main
- release-[0-9]+.[0-9]+
env:
VERSION_TAG: ${{ github.ref_name }}
REPOSITORY: quay.io/gatekeeper/gatekeeper
jobs:
build:
name: Image build and push
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491
with:
go-version: "1.22"
check-latest: true
- name: build
run: |
REPOSITORY=${{env.REPOSITORY}} VERSION=${{env.VERSION_TAG}} \
PLATFORM="linux/amd64,linux/arm64,linux/arm/v7" OUTPUT_TYPE=type=registry GENERATE_ATTESTATIONS=true make docker-buildx-release
- uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAY_USER }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: push
run: |
docker push ${{env.REPOSITORY}}:${{env.VERSION_TAG}}