Skip to content

Generate tagged Harmonic RoboticsAcademy image #8

Generate tagged Harmonic RoboticsAcademy image

Generate tagged Harmonic RoboticsAcademy image #8

# Generates and uploads an image of Robotics-Academy using the desired tag and branches
name: Generate tagged Harmonic RoboticsAcademy image
on:
workflow_call:
inputs:
tag:
description: 'Docker Image Tag'
required: true
default: test
type: string
RA:
description: 'Branch of RoboticsAcademy'
required: true
default: humble-devel
type: string
RI:
description: 'Branch of Robotics Infrastructure'
required: true
default: humble-devel
type: string
RAM:
description: 'Branch of Robotics Application Manager'
required: true
default: humble-devel
type: string
ROS:
description: 'ROS Distro (humble)'
required: true
default: humble
type: string
workflow_dispatch:
inputs:
tag:
description: 'Docker Image Tag'
required: true
default: test
type: string
RA:
description: 'Branch of RoboticsAcademy'
required: true
default: humble-devel
type: string
RI:
description: 'Branch of Robotics Infrastructure'
required: true
default: humble-devel
type: string
RAM:
description: 'Branch of Robotics Application Manager'
required: true
default: humble-devel
type: string
ROS:
description: 'ROS Distro (humble)'
required: true
default: humble
type: string
jobs:
push_to_registry:
name: Run Test and Update Docker Image
runs-on: ubuntu-latest
steps:
- name: Check out the repo # checking our the code at current commit that triggers the workflow
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.branch-webserver-id }}
fetch-depth: 1
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build base image
run: |
sudo apt-get update
cd scripts
if [ "${{ github.event.inputs.ROS }}" == "humble" ]; then
docker build -f Dockerfile.dependencies_humble_mix_gazebo -t jderobot/robotics-applications:dependencies-humble .
else
echo "Incorrect ROS version"
fi
- name: Build and push RADI
run: |
cd scripts
if [ "${{ github.event.inputs.ROS }}" == "humble" ]; then
docker build --no-cache -f Dockerfile.humble_RA \
--build-arg ROBOTICS_ACADEMY=${{ github.event.inputs.RA }}\
--build-arg ROBOTICS_INFRASTRUCTURE=${{ github.event.inputs.RI }} \
--build-arg RAM=${{ github.event.inputs.RAM }} \
--build-arg ROS_DISTRO=${{ github.event.inputs.ROS }} \
--build-arg IMAGE_TAG=${{ github.event.inputs.tag }} \
-t jderobot/robotics-academy:${{ github.event.inputs.tag }} .
docker push jderobot/robotics-academy:${{ github.event.inputs.tag }}
else
echo "Incorrect ROS version"
fi