docker-build-pc #12
Workflow file for this run
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
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 | |
docker images | |
if [ "$(docker images -q $docker_tag 2> /dev/null)" == "" ]; then | |
echo "Docker image $docker_tag does not exist." | |
exit 1 | |
else | |
echo "FROM --platform=linux/amd64 $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 | |
fi | |
- 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 |