-
Notifications
You must be signed in to change notification settings - Fork 3
114 lines (104 loc) · 3.47 KB
/
buildroot.yml
File metadata and controls
114 lines (104 loc) · 3.47 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# SPDX-FileCopyrightText: Timothée Ravier <tim@siosm.fr>
# SPDX-License-Identifier: CC0-1.0
name: "Build buildroot container image for CI"
env:
NAME: "${{ github.event.repository.name }}"
REGISTRY: "ghcr.io/${{ github.repository_owner }}"
on:
pull_request:
branches:
- "main"
paths:
- 'Containerfile'
- '.github/workflows/buildroot.yml'
push:
branches:
- "main"
paths:
- 'Containerfile'
- '.github/workflows/buildroot.yml'
schedule:
- cron: '0 0 * * MON'
workflow_dispatch:
# Allow:
# - Read access to the repo content
# - Write access to packages to allow access to GitHub container registry
permissions:
contents: read
packages: write
# Prevent multiple workflow runs from racing to ensure that pushes are made
# sequentialy for the main branch. Also cancel in progress workflow runs.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ${{ matrix.runner }}
strategy:
matrix:
include:
- tag: fedora
base: quay.io/fedora/fedora:latest
arch: x86_64
runner: ubuntu-24.04
- tag: fedora
base: quay.io/fedora/fedora:latest
arch: aarch64
runner: ubuntu-24.04-arm
- tag: centos-stream
base: quay.io/centos/centos:stream9
arch: x86_64
runner: ubuntu-24.04
- tag: centos-stream
base: quay.io/centos/centos:stream9
arch: aarch64
runner: ubuntu-24.04-arm
steps:
- name: Checkout repo
uses: actions/checkout@v5
- name: Build container image
uses: redhat-actions/buildah-build@v2
with:
context: .github
image: ${{ env.NAME }}
tags: ${{ matrix.tag }}-${{ matrix.arch }}
containerfiles: Containerfile
oci: true
build-args: |
BASE=${{ matrix.base }}
- name: Push to Container Registry
uses: redhat-actions/push-to-registry@v2
id: push
if: (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main'
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
image: ${{ env.NAME }}
tags: ${{ matrix.tag }}-${{ matrix.arch }}
merge:
runs-on: ubuntu-24.04
needs:
- build
strategy:
matrix:
tag: [fedora, centos-stream]
steps:
- name: Create multi-arch manifest
if: (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main'
shell: bash
run: |
set -euxo pipefail
buildah manifest create "${REGISTRY}/${NAME}:${{ matrix.tag }}" \
"${REGISTRY}/${NAME}:${{ matrix.tag }}-x86_64" \
"${REGISTRY}/${NAME}:${{ matrix.tag }}-aarch64"
- name: Push to Container Registry
uses: redhat-actions/push-to-registry@v2
id: push
if: (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main'
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
image: ${{ env.NAME }}
tags: ${{ matrix.tag }}