Merge pull request #77 from adrianchiris/add-image-build-test #5
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: "push images on merge to master" | |
env: | |
IMAGE_NAME: ghcr.io/${{ github.repository }} | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build-and-push-amd64-accelerated-bridge-cni: | |
name: image push amd64 | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: check out the repo | |
uses: actions/checkout@v4 | |
- name: set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: login to Docker | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: build and push accelerated-bridge-cni | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
platforms: linux/amd64 | |
tags: | | |
${{ env.IMAGE_NAME }}:latest-amd64 | |
file: ./Dockerfile | |
build-and-push-arm64-accelerated-bridge-cni: | |
name: image push arm64 | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: check out the repo | |
uses: actions/checkout@v4 | |
- name: set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: login to Docker | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: build and push accelerated-bridge-cni | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
platforms: linux/arm64 | |
tags: | | |
${{ env.IMAGE_NAME }}:latest-arm64 | |
file: ./Dockerfile | |
build-and-push-ppc64le-accelerated-bridge-cni: | |
name: image Push ppc64le | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: check out the repo | |
uses: actions/checkout@v4 | |
- name: set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: login to Docker | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: build and push accelerated-bridge-cni | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
platforms: linux/ppc64le | |
tags: | | |
${{ env.IMAGE_NAME }}:latest-ppc64le | |
file: ./Dockerfile | |
push-manifest: | |
runs-on: ubuntu-22.04 | |
needs: [build-and-push-amd64-accelerated-bridge-cni,build-and-push-arm64-accelerated-bridge-cni,build-and-push-ppc64le-accelerated-bridge-cni] | |
steps: | |
- name: set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create manifest for multi-arch images | |
run: | | |
docker buildx imagetools create -t ${{ env.IMAGE_NAME }}:latest -t ${{ env.IMAGE_NAME }}:sha-${{ github.sha }} \ | |
${{ env.IMAGE_NAME }}:latest-amd64 \ | |
${{ env.IMAGE_NAME }}:latest-arm64 \ | |
${{ env.IMAGE_NAME }}:latest-ppc64le |