Skip to content
This repository was archived by the owner on Oct 6, 2025. It is now read-only.

Fix Dockerfile path in deployment workflow for ARM64 build #5

Fix Dockerfile path in deployment workflow for ARM64 build

Fix Dockerfile path in deployment workflow for ARM64 build #5

Workflow file for this run

name: Build and Deploy for Raspberry Pi
on:
push:
branches:
- 76-task-deploy-workflow-for-raspberry-pi-repo # Or your main branch, e.g., 'main' or 'master'
tags:
- 'v*'
jobs:
build-and-deploy:
runs-on: ubuntu-latest
env:
PROJECT_DIR: RaspberryPi # Define PROJECT_DIR here
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: false
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: linux/arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker image for ARM64
run: |
docker buildx build \
-f deploy/dockerfiles/DockerfileDeployRasp \
--platform linux/arm64 --load \
--build-arg projectDir=$PROJECT_DIR \
-t final-app .
- name: Extract built binaries
run: |
mkdir -p artifacts/bin
mkdir -p artifacts/config
mkdir -p artifacts/fonts
docker create --name tmpapp final-app
# Assuming your Dockerfile puts the apps under /home/RaspberryPi/ within the container
docker cp tmpapp:/home/$PROJECT_DIR/InstrumentClusterApp ./artifacts/bin/
docker cp tmpapp:/home/$PROJECT_DIR/MiddleWareApp ./artifacts/bin/
# These paths should be relative to the root of the checked out repo
cp ./ZenohConfig/InstrumentClusterConfig.json ./artifacts/config/
cp ./ZenohConfig/MiddleWareConfig.json ./artifacts/config/
cp -r ./deploy/fonts/* ./artifacts/fonts/
git archive --format=zip HEAD -o ./artifacts/source-code.zip
cd artifacts
zip -r ../release-package.zip *
cd ..
docker rm tmpapp
- name: Get latest tag and increment
id: tag
run: |
git fetch --tags --force
git fetch origin
latest_tag=$(git tag --sort=-v:refname | head -n 1)
if [ -z "$latest_tag" ]; then
latest_tag="v1.0.0"
fi
major=$(echo $latest_tag | cut -d. -f1 | tr -d 'v')
minor=$(echo $latest_tag | cut -d. -f2)
patch=$(echo $latest_tag | cut -d. -f3)
new_tag="v$major.$minor.$((patch + 1))"
echo "new_tag=$new_tag" >> $GITHUB_OUTPUT
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.tag.outputs.new_tag }}
name: Release ${{ steps.tag.outputs.new_tag }}
body: |
## Raspberry Pi Release
**Includes:**
- Compiled apps (`InstrumentClusterApp`, `MiddleWareApp`)
- Zenoh config files
- Fonts
- Full source code zip
**Instructions:**
- Copy `InstrumentClusterApp` and `MiddleWareApp` to `$PI_PATH_BIN`
- Copy configs to `$PI_PATH_ETC`
- Copy fonts to `$PI_PATH_FONTS`
files: |
release-package.zip
artifacts/source-code.zip
artifacts/bin/*
env:
GITHUB_TOKEN: ${{ secrets.PAT_LUIS }}