-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (55 loc) · 2.37 KB
/
main.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
# Workflow that performs builds of k8snetworkplumbingwg/sriov-network-operator images
# The images are also pushed to quay.io if it's not a pull request
name: Multi-arch and multi-distro build for sriov-network-* container images
on:
pull_request:
push:
schedule:
- cron: '0 0 * * *' # every day at midnight
workflow_dispatch:
jobs:
build:
strategy:
matrix:
container: [ operator, config-daemon, webhook ]
distro-name: [ centos-stream ]
distro-version: [ 9 ]
runs-on: ubuntu-latest
steps:
- name: Checkout current repository for the Dockerfiles
uses: actions/checkout@v2
- name: Lint Dockerfile
if: github.event_name == 'pull_request'
uses: hadolint/[email protected]
with:
dockerfile: ${{ matrix.distro-name }}/${{ matrix.distro-version }}/Dockerfile.${{ matrix.container }}
failure-threshold: error
- name: Checkout k8snetworkplumbingwg/sriov-network-operator for the code
uses: actions/checkout@v2
with:
repository: k8snetworkplumbingwg/sriov-network-operator
path: sriov-network-operator
- name: Build the ${{ matrix.container }} image for ${{ matrix.distro-name }}-${{ matrix.distro-version }}
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: sriov-network-${{ matrix.container }}
tags: "${{ matrix.distro-name }}-${{ matrix.distro-version }}"
containerfiles: |
./${{ matrix.distro-name }}/${{ matrix.distro-version }}/Dockerfile.${{ matrix.container }}
context: sriov-network-operator
- name: Push the ${{ matrix.container }} image for ${{ matrix.distro-name }}-${{ matrix.distro-version }} to Quay.io
id: push-to-quay
if: |
github.event_name == 'schedule' ||
(
( github.event_name == 'push' || github.event_name == 'workflow_dispatch' ) &&
( github.ref == 'refs/head/main' || startsWith(github.ref, 'refs/head/release' ))
)
uses: redhat-actions/push-to-registry@v2
with:
image: sriov-network-${{ matrix.container }}
tags: "${{ matrix.distro-name }}-${{ matrix.distro-version }}"
registry: quay.io/rh-ecosystem-edge
username: ${{ secrets.QUAY_ROBOT_USERNAME }}
password: ${{ secrets.QUAY_ROBOT_TOKEN }}