Skip to content

Commit

Permalink
chore: enable gh runner to build mutiarch
Browse files Browse the repository at this point in the history
Signed-off-by: Adrian Riobo <ariobolo@redhat.com>
  • Loading branch information
adrianriobo committed Oct 18, 2024
1 parent 1cb5155 commit 99db394
Showing 1 changed file with 40 additions and 34 deletions.
74 changes: 40 additions & 34 deletions .github/workflows/build-oci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,38 +13,44 @@ jobs:
name: build-mapt
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Build image for PR
if: ${{ github.event_name == 'pull_request' }}
shell: bash
run: |
IMG=ghcr.io/redhat-developer/mapt:pr-${{ github.event.number }} make oci-build
podman save -o mapt.tar ghcr.io/redhat-developer/mapt:pr-${{ github.event.number }}
echo "ghcr.io/redhat-developer/mapt:pr-${{ github.event.number }}" > mapt-image
- name: Save image for PR
uses: actions/upload-artifact@v4
with:
name: mapt
path: mapt*

- name: Build image
if: ${{ github.event_name != 'pull_request' }}
shell: bash
run: make oci-build

- name: Log in to quay.io Registry
if: ${{ github.event_name != 'pull_request' }}
uses: redhat-actions/podman-login@v1
with:
registry: quay.io
username: ${{ secrets.QUAY_IO_USERNAME }}
password: ${{ secrets.QUAY_IO_PASSWORD }}

- name: Push image
if: ${{ github.event_name != 'pull_request' }}
shell: bash
run: make oci-push
# Allow emulation for building multi arch images
- name: Prepare runner
shell: bash
run: |
sudo apt-get install -y qemu-user-static
- name: Checkout code
uses: actions/checkout@v4

- name: Build image for PR
if: ${{ github.event_name == 'pull_request' }}
shell: bash
run: |
IMG=ghcr.io/redhat-developer/mapt:pr-${{ github.event.number }} make oci-build
podman save -o mapt.tar ghcr.io/redhat-developer/mapt:pr-${{ github.event.number }}
echo "ghcr.io/redhat-developer/mapt:pr-${{ github.event.number }}" > mapt-image
- name: Save image for PR
uses: actions/upload-artifact@v4
with:
name: mapt
path: mapt*

- name: Build image
if: ${{ github.event_name != 'pull_request' }}
shell: bash
run: make oci-build

- name: Log in to quay.io Registry
if: ${{ github.event_name != 'pull_request' }}
uses: redhat-actions/podman-login@v1
with:
registry: quay.io
username: ${{ secrets.QUAY_IO_USERNAME }}
password: ${{ secrets.QUAY_IO_PASSWORD }}

- name: Push image
if: ${{ github.event_name != 'pull_request' }}
shell: bash
run: make oci-push

0 comments on commit 99db394

Please sign in to comment.