correct #33
This file contains 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
# GitHub hosted runner with QEMU + Docker Buildx | |
# Runs Docker custom ARM64 image to compile repo and uploads binary | |
# Deploys to Jetson Nano via a self-hosted runner. | |
name: CI/CD | |
on: | |
push: | |
# branches: | |
# - main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Docker QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Pull Jetson Nano Ubuntu Docker image | |
run: docker pull jmoreiraseame/jetson-nano-ubuntu:bionic | |
- name: Build project | |
run: | | |
docker run --rm --platform linux/arm64 \ | |
-v ${{ github.workspace }}:/repo \ | |
-w /repo jmoreiraseame/jetson-nano-ubuntu:bionic \ | |
/bin/bash -c " | |
mkdir -p /repo/build && \ | |
cd /repo/build && \ | |
cmake .. && \ | |
make && \ | |
mkdir -p /repo/bin && \ | |
cp jetson06 /repo/bin/ && \ | |
ldd jetson06 | |
" | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build-artifact | |
path: bin/jetson06 | |
deploy: | |
runs-on: [seame] | |
needs: build | |
steps: | |
- name: Ensure target directory exists | |
run: mkdir -p ./team06/bin | |
- name: Download build artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: build-artifact | |
path: ./bin | |
- name: SSH to Jetson and copy binary | |
run: | | |
sshpass -p "${{ secrets.JETSON_PASSWORD }}" \ | |
scp -r ./bin \ | |
team06@10.21.221.56:/home/team06/ | |
- name: SSH to Jetson and run binary | |
run: | | |
sshpass -p "${{ secrets.JETSON_PASSWORD }}" \ | |
ssh team06@10.21.221.56 'chmod +x /home/team06/bin/jetson06 && /home/team06/bin/jetson06' |