In order to use the containers in CI build
the containers regularly so everything is up
to date. Currently, there is only Fedora container,
but it can be extended as needed.

Signed-off-by: Ales Musil <[email protected]>
---
The testing job is available here: 
https://github.com/almusil/ovn/actions/runs/4413861354/jobs/7734843263
---
 .github/workflows/containers.yaml | 54 +++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)
 create mode 100644 .github/workflows/containers.yaml

diff --git a/.github/workflows/containers.yaml 
b/.github/workflows/containers.yaml
new file mode 100644
index 000000000..e4fae1c26
--- /dev/null
+++ b/.github/workflows/containers.yaml
@@ -0,0 +1,54 @@
+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:
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        distro: [ fedora ]
+    steps:
+      - uses: actions/checkout@v3
+
+      - 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
+          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 }}"
-- 
2.39.2

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to