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

Commit 8dbd109

Browse files
committed
Refactor deployment workflow to optimize disk space management and update job structure
1 parent bc5fa2e commit 8dbd109

1 file changed

Lines changed: 23 additions & 18 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,20 @@ on:
88
- 'v*'
99

1010
jobs:
11-
build-and-deploy:
11+
build:
1212
runs-on: ubuntu-latest
13-
env:
14-
PROJECT_DIR: RaspberryPi
15-
DOCKER_BUILDKIT: 1
16-
BUILDX_LOG_LEVEL: debug
1713

1814
steps:
19-
- name: Checkout repository
15+
- name: Free up disk space
16+
run: |
17+
sudo rm -rf /usr/share/dotnet
18+
sudo rm -rf /opt/ghc
19+
sudo rm -rf /usr/local/share/boost
20+
sudo rm -rf /usr/lib/jvm
21+
sudo docker system prune -af
22+
23+
- name: Checkout code
2024
uses: actions/checkout@v4
21-
with:
22-
submodules: false
2325

2426
- name: Set up QEMU
2527
uses: docker/setup-qemu-action@v2
@@ -32,28 +34,32 @@ jobs:
3234
driver: docker-container
3335
buildkitd-flags: --allow-insecure-entitlement network.host
3436

35-
- name: Build and export binaries to local directory
37+
- name: Build Docker image
3638
run: |
37-
rm -rf out/
3839
docker buildx build \
3940
--platform linux/arm64 \
4041
-f deploy/dockerfiles/DockerfileDeployRasp \
41-
--output type=local,dest=out \
4242
--build-arg projectDir=/ \
43-
.
43+
--load \
44+
-t rasp-app .
4445
45-
- name: Prepare artifacts
46+
- name: Extract binaries from Docker image
4647
run: |
48+
docker create --name tmpapp rasp-app
49+
4750
mkdir -p artifacts/bin
51+
docker cp tmpapp:/home/InstrumentClusterApp ./artifacts/bin/
52+
docker cp tmpapp:/home/MiddleWareApp ./artifacts/bin/
53+
54+
docker rm tmpapp
55+
56+
- name: Prepare artifacts
57+
run: |
4858
mkdir -p artifacts/config
4959
mkdir -p artifacts/fonts
5060
51-
cp out/home/InstrumentClusterApp ./artifacts/bin/
52-
cp out/home/MiddleWareApp ./artifacts/bin/
53-
5461
cp ./ZenohConfig/InstrumentClusterConfig.json ./artifacts/config/
5562
cp ./ZenohConfig/MiddleWareConfig.json ./artifacts/config/
56-
5763
cp -r ./deploy/fonts/* ./artifacts/fonts/
5864
5965
git archive --format=zip HEAD -o ./artifacts/source-code.zip
@@ -101,4 +107,3 @@ jobs:
101107
artifacts/bin/*
102108
env:
103109
GITHUB_TOKEN: ${{ secrets.PAT_LUIS }}
104-

0 commit comments

Comments
 (0)