This repository was archived by the owner on Oct 6, 2025. It is now read-only.
Refactor deployment workflow to remove unnecessary environment variab… #16
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Deploy for Raspberry Pi | |
| on: | |
| push: | |
| branches: | |
| - 76-task-deploy-workflow-for-raspberry-pi-repo | |
| tags: | |
| - 'v*' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Free up disk space | |
| run: | | |
| sudo rm -rf /usr/share/dotnet | |
| sudo rm -rf /opt/ghc | |
| sudo rm -rf /usr/local/share/boost | |
| sudo rm -rf /usr/lib/jvm | |
| sudo docker system prune -af | |
| - 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 | |
| with: | |
| driver: docker-container | |
| buildkitd-flags: --allow-insecure-entitlement network.host | |
| - name: Build and export binaries to local directory | |
| run: | | |
| rm -rf out/ | |
| docker buildx build \ | |
| --platform linux/arm64 \ | |
| -f deploy/dockerfiles/DockerfileDeployRasp \ | |
| --output type=local,dest=out \ | |
| --build-arg projectDir=/ \ | |
| . | |
| - name: Prepare artifacts | |
| run: | | |
| mkdir -p artifacts/bin | |
| mkdir -p artifacts/config | |
| mkdir -p artifacts/fonts | |
| cp out/home/InstrumentClusterApp ./artifacts/bin/ | |
| cp out/home/MiddleWareApp ./artifacts/bin/ | |
| 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 .. | |
| - 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 }} |