Skip to content

Commit

Permalink
adjust CI/CD
Browse files Browse the repository at this point in the history
  • Loading branch information
FranekStark committed Sep 23, 2024
1 parent 0149ac4 commit 01ad70d
Showing 1 changed file with 27 additions and 12 deletions.
39 changes: 27 additions & 12 deletions .github/workflows/docker-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ on:
- main

jobs:
build:
runs-on: ubuntu-22.04-large
build-x86:
runs-on: ubuntu-22.04

steps:
# Step 1: Checkout the repository
Expand All @@ -26,29 +26,44 @@ jobs:
- name: Create a builder
run: docker buildx create --use

# Step 4: Build and load Docker image for x86_64 (Ubuntu) locally
# Step 4: Build and load Docker image for x86_64
- name: Build Docker image for x86_64
run: |
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 dfki-quad-x86_64 bash -c "cbg"

build-arm:
runs-on: ubuntu-22.04

steps:
# Step 1: Checkout the repository
- name: Checkout repository
uses: actions/checkout@v3

# Step 5: Build and load Docker image for ARM (Raspberry Pi) locally
# 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: |
run:
docker buildx build \
--platform linux/arm64 \
--build-arg HW_ARCH=aarch64 \
--output=type=docker \
-t dfki-quad-arm docker/

# Step 6a: Run the build inside the Docker container for x86_64
- name: Run build on x86_64
run: docker run --rm --platform linux/amd64 dfki-quad-x86_64 bash -c "cbg"

# Step 6b: Run the build inside the Docker container for ARM
# Step 5b: Run the build inside the Docker container for ARM
- name: Run build on ARM
run: docker run --rm --platform linux/amd64 dfki-quad-arm dfki-quad bash -c "cbg_onboard"
run: docker run --rm --platform linux/amd64 dfki-quad-arm dfki-quad bash -c "cbg_onboard"

0 comments on commit 01ad70d

Please sign in to comment.