diff mbox series

[ovs-dev,4/4] CI: Add automation for building the containers

Message ID 20230314105324.127218-5-amusil@redhat.com
State Changes Requested
Headers show
Series Add automation to automatically build containers | expand

Checks

Context Check Description
ovsrobot/apply-robot warning apply and check: warning
ovsrobot/github-robot-_Build_and_Test fail github build: failed
ovsrobot/github-robot-_ovn-kubernetes success github build: passed

Commit Message

Ales Musil March 14, 2023, 10:53 a.m. UTC
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 <amusil@redhat.com>
---
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

Comments

0-day Robot March 14, 2023, 12:02 p.m. UTC | #1
Bleep bloop.  Greetings Ales Musil, I am a robot and I have tried out your patch.
Thanks for your contribution.

I encountered some error that I wasn't expecting.  See the details below.


checkpatch:
WARNING: Line is 81 characters long (recommended limit is 79)
#63 FILE: .github/workflows/containers.yaml:41:
          dockerfiles: ${{ env.CONTAINERS_PATH }}/${{ matrix.distro }}/Dockerfile

WARNING: Line is 88 characters long (recommended limit is 79)
#76 FILE: .github/workflows/containers.yaml:54:
        run: echo "Image pushed to ${{ steps.push-to-registry.outputs.registry-paths }}"

Lines checked: 80, Warnings: 2, Errors: 0


Please check this out.  If you feel there has been an error, please email aconole@redhat.com

Thanks,
0-day Robot
diff mbox series

Patch

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 }}"