-
Notifications
You must be signed in to change notification settings - Fork 17
125 lines (119 loc) · 3.71 KB
/
generate_Bt_Studio.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# Generates and uploads an image of BT-Studio using the desired tag and branches
name: Generate tagged BT-Studio image
on:
workflow_call:
inputs:
tag:
description: 'Docker Image Tag'
required: true
default: test
type: string
latest:
description: 'Upload as latest'
required: true
default: false
type: boolean
BT:
description: 'Branch of BT-Studio'
required: true
default: main
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
latest:
description: 'Upload as latest'
required: true
default: false
type: boolean
BT:
description: 'Branch of BT-Studio'
required: true
default: main
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
env:
TAG: ${{ github.event.inputs.tag }}
steps:
- name: Save the version tag
run: echo "TAG=${TAG#v}" >> $GITHUB_ENV
- 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/BTDI
if [ "${{ github.event.inputs.ROS }}" == "humble" ]; then
docker build -f Dockerfile.dependencies_humble -t jderobot/robotics-applications:dependencies-humble .
else
echo "Incorrect ROS version"
fi
- name: Build and push BTDI
run: |
cd scripts/BTDI
if [ "${{ github.event.inputs.ROS }}" == "humble" ]; then
docker build --no-cache -f Dockerfile.humble \
--build-arg BT_STUDIO=${{ github.event.inputs.BT }}\
--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=${TAG} \
-t jderobot/bt-studio:${TAG} .
docker push jderobot/bt-studio:${TAG}
else
echo "Incorrect ROS version"
fi
- name: Upload as Latest
if: ${{ inputs.latest }}
run: |
docker image tag jderobot/bt-studio:${TAG} jderobot/bt-studio:latest
docker push jderobot/bt-studio:latest