-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (81 loc) · 3.23 KB
/
generate_Harmonic_Robotics_Backend.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# Generates and uploads an image of Robotics-Backend using the desired tag and branches
name: Generate tagged Harmonic RoboticsBackend image
on:
workflow_dispatch:
inputs:
tag:
description: 'Docker Image Tag'
required: true
default: test
RI:
description: 'Branch of Robotics Infrastructure'
required: true
default: humble-devel
RAM:
description: 'Branch of Robotics Application Manager'
required: true
default: humble-devel
ROS:
description: 'ROS Distro (humble)'
required: true
default: humble
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: Cache dependency # caching dependency will make our build faster.
# uses: actions/cache@v3 # for more info checkout pip section documentation at https://github.com/actions/cache
# with:
# path: ~/.cache/pip
# key: ${{ runner.os }}-pip-${{ hashFiles('**/utils/requirements.txt') }}
# restore-keys: |
# ${{ runner.os }}-pip-
# - name: Setup python environment # setting python environment to 3.8
# uses: actions/setup-python@v3
# with:
# python-version: '3.8'
# - name: Check Python version # checking the python version to see if 3.8 is installed.
# run: python --version
- 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 \
--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-backend:${{ github.event.inputs.tag }} .
docker push jderobot/robotics-backend:${{ github.event.inputs.tag }}
else
echo "Incorrect ROS version"
fi
- name: Upload as Latest
if: ${{ inputs.latest }}
run: |
docker image tag jderobot/robotics-backend:${{ github.event.inputs.tag }} jderobot/robotics-backend:latest
docker push jderobot/robotics-backend:latest