-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (61 loc) · 2.25 KB
/
docker-build-pc.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: docker-build-pc
on:
workflow_dispatch:
env:
SDK_DIR: /home/runner/work/robotics_sdk
REPO_URL: https://git.ti.com/git/processor-sdk-vision/jacinto_ros_perception.git
REPO_TAG: REL.10.00.00
# only for testing
# REPO_BRANCH: 10_00_rc4
SDK_VER: 10.0.0
GH_TOKEN: ${{ secrets.GHCR_PAT }}
jobs:
build_pc:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GHCR_PAT }}
- name: Clone SDK repository
run: |
git clone --branch ${{ env.REPO_TAG }} --single-branch ${{ env.REPO_URL }} ${{ env.SDK_DIR }}
# gh repo clone robotics_sdk ${{ env.SDK_DIR }} -- --branch ${{ env.REPO_BRANCH }}
- name: Set up Docker build script
run: |
mkdir -p $HOME/j7ros_home
cd $HOME/j7ros_home
makefile_path=$SDK_DIR/docker/Makefile
if [ -f $makefile_path ]; then
ln -snf $SDK_DIR/docker/Makefile .
else
echo "Error: $makefile_path does not exist"
exit 1
fi
PLATFORM=pc SDK_DIR=$SDK_DIR make scripts
- name: Verify script generation
run: |
ls -l $HOME/j7ros_home
more $HOME/j7ros_home/docker_build.sh
- name: Build Docker image
run: |
cd $HOME/j7ros_home
./docker_build.sh
- name: Add a Docker label
run: |
docker_tag=robotics-sdk:${{ env.SDK_VER }}-humble-viz
echo "FROM $docker_tag" | docker build --label org.opencontainers.image.source=https://github.com/${{ github.repository }} -t $docker_tag -
docker inspect --format='{{json .Config.Labels}}' $docker_tag
- name: Push Docker image
run: |
docker_tag=robotics-sdk:${{ env.SDK_VER }}-humble-viz
remote_docker_tag=ghcr.io/${{ github.repository_owner }}/$docker_tag
remote_docker_tag=${remote_docker_tag,,}
docker tag $docker_tag $remote_docker_tag
docker push $remote_docker_tag