-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (48 loc) · 1.88 KB
/
docker-build.yaml
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
name: CI Multi-Platform Docker Build
# Triggers the workflow on push and pull request events
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build-x86_64:
runs-on: ubuntu-22.04
steps:
# Step 1: Checkout the repository
- name: Checkout repository
uses: actions/checkout@v3
# Step 2: Set up Docker Buildx for multi-platform builds
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
# Step 3: Create a builder instance
- name: Create a builder
run: docker buildx create --use
# Step 4: Build and load Docker image for x86_64
- name: Build Docker image for x86_64
run: docker buildx build --platform linux/amd64 --build-arg HW_ARCH=x86_64 --output=type=docker -t dfki-quad-x86_64 docker
# Step 5a: Run the build inside the Docker container for x86_64
- name: Run build on x86_64
run: docker run --rm --platform linux/amd64 --volume="${PWD}/ws/src:/root/ros2_ws/src" dfki-quad-x86_64 bash -ic "cbg"
build-arm64:
runs-on: ubuntu-22.04
steps:
# Step 1: Checkout the repository
- name: Checkout repository
uses: actions/checkout@v3
# Step 2: Set up Docker Buildx for multi-platform builds
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
# Step 3: Create a builder instance
- name: Create a builder
run: docker buildx create --use
# Step 4: Build and load Docker image for ARM (Raspberry Pi) locally
- name: Build Docker image for ARM
run:
docker buildx build --platform linux/arm64 --build-arg HW_ARCH=aarch64 --output=type=docker -t dfki-quad-arm docker
# Step 5b: Run the build inside the Docker container for ARM
- name: Run build on ARM
run:
docker run --rm --platform linux/arm64 --volume="${PWD}/ws/src:/root/ros2_ws/src" dfki-quad-arm bash -ic "cbg_onboard"