Skip to content

Merge pull request #58 from adrianchiris/fix-manifest-build #10

Merge pull request #58 from adrianchiris/fix-manifest-build

Merge pull request #58 from adrianchiris/fix-manifest-build #10

name: "push images on merge to master"
env:
IMAGE_NAME: ghcr.io/${{ github.repository }}
on:
push:
branches:
- master
jobs:
build-and-push-amd64-rdma-cni:
name: image push amd64
runs-on: ubuntu-22.04
steps:
- name: check out the repo
uses: actions/checkout@v3
- name: set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: login to Docker
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: build and push rdma-cni
uses: docker/build-push-action@v4
with:
context: .
push: true
platforms: linux/amd64
tags: |
${{ env.IMAGE_NAME }}:latest-amd64
${{ env.IMAGE_NAME }}:${{ github.sha }}
file: ./Dockerfile
build-and-push-arm64-rdma-cni:
name: image push arm64
runs-on: ubuntu-22.04
steps:
- name: check out the repo
uses: actions/checkout@v3
- name: set up QEMU
uses: docker/setup-qemu-action@v2
- name: set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: login to Docker
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: build and push rdma-cni
uses: docker/build-push-action@v4
with:
context: .
push: true
platforms: linux/arm64
tags: |
${{ env.IMAGE_NAME }}:latest-arm64
file: ./Dockerfile.arm64
build-and-push-ppc64le-rdma-cni:
name: image Push ppc64le
runs-on: ubuntu-22.04
steps:
- name: check out the repo
uses: actions/checkout@v3
- name: set up QEMU
uses: docker/setup-qemu-action@v2
- name: set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: login to Docker
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: build and push rdma-cni
uses: docker/build-push-action@v4
with:
context: .
push: true
platforms: linux/ppc64le
tags: |
${{ env.IMAGE_NAME }}:latest-ppc64le
file: ./Dockerfile.ppc64le
push-manifest:
runs-on: ubuntu-22.04
needs: [build-and-push-amd64-rdma-cni,build-and-push-arm64-rdma-cni,build-and-push-ppc64le-rdma-cni]
steps:
- name: set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: login to GitHub Container Registry
uses: docker/login-action@v2
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 \
${{ env.IMAGE_NAME }}:latest-amd64 \
${{ env.IMAGE_NAME }}:latest-arm64 \
${{ env.IMAGE_NAME }}:latest-ppc64le