-
Notifications
You must be signed in to change notification settings - Fork 7
74 lines (61 loc) · 1.63 KB
/
build-oci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: oci-builds
on:
push:
branches: [ main ]
tags:
- '*'
pull_request:
branches: [ main ]
jobs:
build:
name: build
runs-on: ubuntu-24.04
steps:
- name: Prepare runner for build multi arch
shell: bash
run: |
sudo apt-get update && 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'
env:
IMG: ghcr.io/redhat-developer/mapt:pr-${{ github.event.number }}
shell: bash
run: |
make oci-build
make oci-save
echo ${IMG} > mapt-image
- name: Build and Push image for Release
if: github.event_name == 'push'
run: |
make oci-build
make oci-save
- name: Upload mapt artifacts for PR
uses: actions/upload-artifact@v4
with:
name: mapt
path: mapt*
push:
name: push
if: github.event_name == 'push'
needs: build
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download mapt oci flatten images
uses: actions/download-artifact@v4
with:
name: mapt
- name: Log in quay.io
uses: redhat-actions/podman-login@v1
with:
registry: quay.io
username: ${{ secrets.QUAY_IO_USERNAME }}
password: ${{ secrets.QUAY_IO_PASSWORD }}
- name: Push image for Release
if: github.event_name == 'push'
run: |
make oci-load
make oci-push