forked from ovn-org/ovn
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (48 loc) · 1.58 KB
/
containers.yml
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
name: Containers
on:
# Be able to run the job manually when needed
workflow_dispatch:
# Build every week on Monday 00:00
schedule:
- cron: '0 0 * * 1'
env:
IMAGE_REGISTRY: ghcr.io
IMAGE_NAMESPACE: ovn-org
IMAGE_NAME: ovn-tests
CONTAINERS_PATH: ./utilities/containers
DEPENDENCIES: podman
jobs:
container:
if: github.repository_owner == 'ovn-org'
runs-on: ubuntu-24.04
strategy:
matrix:
distro: [ fedora, ubuntu ]
steps:
- uses: actions/checkout@v4
- name: Update APT cache
run: sudo apt update
- name: Install dependencies
run: sudo apt install -y ${{ env.DEPENDENCIES }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Build container images
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.IMAGE_NAME }}
archs: amd64, arm64
tags: ${{ matrix.distro }}
build-args: CONTAINERS_PATH=${{ env.CONTAINERS_PATH }}
dockerfiles: ${{ env.CONTAINERS_PATH }}/${{ matrix.distro }}/Dockerfile
- name: Push to ghcr.io
id: push-to-registry
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAMESPACE }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Print image url
run: echo "Image pushed to ${{ steps.push-to-registry.outputs.registry-paths }}"