Skip to content

Commit f11e494

Browse files
author
Adrian Auer
committed
now build all images
1 parent b909630 commit f11e494

1 file changed

Lines changed: 39 additions & 23 deletions

File tree

.github/workflows/build_and_push_docker_images.yml

Lines changed: 39 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010
env:
1111
REGISTRY: ghcr.io
1212
IMAGE_NAME: ${{ github.repository }}
13+
ROS_DISTRO: jazzy
1314

1415
# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu.
1516
jobs:
@@ -20,8 +21,30 @@ jobs:
2021
contents: read
2122
packages: write
2223
attestations: write
23-
id-token: write
24-
#
24+
id-token: write
25+
strategy:
26+
matrix:
27+
variant:
28+
- name: teleop
29+
platforms: linux/arm64
30+
context: .
31+
file: ./docker/Dockerfile-teleop
32+
- name: ricbot
33+
platforms: linux/arm64
34+
context: .
35+
file: ./docker/Dockerfile-robot
36+
- name: ui
37+
platforms: linux/arm64
38+
context: ./svelte-ui/
39+
file: ./docker/Dockerfile
40+
- name: ui_com
41+
platforms: linux/arm64
42+
context: ./helloric_ui_com/
43+
file: ./Dockerfile
44+
- name: ds4
45+
platforms: linux/arm64
46+
context: .
47+
file: ./docker/Dockerfile-ds4
2548
steps:
2649
- name: Checkout repository
2750
uses: actions/checkout@v5
@@ -34,55 +57,48 @@ jobs:
3457
registry: ${{ env.REGISTRY }}
3558
username: ${{ github.actor }}
3659
password: ${{ secrets.GITHUB_TOKEN }}
37-
38-
# This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels.
60+
# as suggested here: https://github.com/docker/build-push-action
61+
- name: Set up QEMU
62+
uses: docker/setup-qemu-action@v3
63+
- name: Set up Docker Buildx
64+
uses: docker/setup-buildx-action@v3
65+
# This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels.
3966
- name: Extract metadata (tags, labels) for Docker
4067
id: meta
4168
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
4269
with:
43-
images: ${{ env.REGISTRY }}/helloric/teleop
70+
images: ${{ env.REGISTRY }}/helloric/${{ matrix.variant.name }}
4471
tags: |
4572
type=raw,value=${{ github.sha }}
4673
type=raw,value=latest
4774
labels: |
4875
labels: |
49-
org.opencontainers.image.title=HelloRic Teleop
50-
org.opencontainers.image.description=Docker image for HelloRic teleop node
76+
org.opencontainers.image.title=HelloRic ${{ matrix.variant.name }}
77+
org.opencontainers.image.description=Docker image for HelloRic ${{ matrix.variant.name }} node
5178
org.opencontainers.image.url=https://github.com/helloric/robot-nodes
5279
org.opencontainers.image.vendor=DFKI RIC
5380
org.opencontainers.image.licenses=3-Clause BSD License
54-
55-
56-
57-
58-
# as suggested here: https://github.com/docker/build-push-action
59-
-
60-
name: Set up QEMU
61-
uses: docker/setup-qemu-action@v3
62-
-
63-
name: Set up Docker Buildx
64-
uses: docker/setup-buildx-action@v3
6581
# This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages.
6682
# It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see [Usage](https://github.com/docker/build-push-action#usage) in the README of the `docker/build-push-action` repository.
6783
# It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step.
6884
- name: Build and push TELEOP Docker image
6985
id: push
7086
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
7187
with:
72-
context: .
73-
file: ./docker/Dockerfile-teleop
88+
context: ${{ matrix.variant.context }}
89+
file: ${{ matrix.variant.file }}
7490
build-args: |
75-
ROS_DISTRO=jazzy
91+
ROS_DISTRO=${{ env.ROS_DISTRO }}
7692
push: true
7793
tags: ${{ steps.meta.outputs.tags }}
7894
labels: ${{ steps.meta.outputs.labels }}
79-
platforms: linux/arm64
95+
platforms: ${{ matrix.variant.platforms }}
8096

8197
# This step generates an artifact attestation for the image, which is an unforgeable statement about where and how it was built. It increases supply chain security for people who consume the image. For more information, see [Using artifact attestations to establish provenance for builds](/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds).
8298
- name: Generate artifact attestation
8399
uses: actions/attest-build-provenance@v3
84100
with:
85-
subject-name: ${{ env.REGISTRY }}/helloric/teleop
101+
subject-name: ${{ env.REGISTRY }}/helloric/${{ matrix.variant.name }}
86102
subject-digest: ${{ steps.push.outputs.digest }}
87103
push-to-registry: true
88104

0 commit comments

Comments
 (0)