-
Notifications
You must be signed in to change notification settings - Fork 4
45 lines (44 loc) · 1.47 KB
/
build-push-images.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
name: Build and Push Images
on:
push:
branches:
- main
- release-*
jobs:
build_push:
if: (github.repository == 'netobserv/must-gather')
name: Build and Push Images
runs-on: ubuntu-latest
env:
REGISTRY_USERNAME: netobserv+github_ci
REGISTRY_PASSWORD: ${{ secrets.QUAY_SECRET }}
REGISTRY_NAMESPACE: netobserv
MULTIARCH_TARGETS: amd64 arm64 ppc64le s390x
steps:
- name: Checkout the latest code
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Check build
run: |
make lint MUST_GATHER_IMAGE=$REGISTRY_NAMESPACE/must-gather
- name: Build image
run: |
MULTIARCH_TARGETS="${{ env.MULTIARCH_TARGETS }}" make image-build MUST_GATHER_IMAGE=$REGISTRY_NAMESPACE/must-gather
- name: podman login to quay.io
uses: redhat-actions/podman-login@v1
with:
username: ${{ env.REGISTRY_USERNAME }}
password: ${{ env.REGISTRY_PASSWORD }}
registry: quay.io
- name: get short sha
run: |
echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Push image
run: |
IMAGE_TAG=${{ env.short_sha }}
MULTIARCH_TARGETS="${{ env.MULTIARCH_TARGETS }}" make build MUST_GATHER_IMAGE=$REGISTRY_NAMESPACE/must-gather