-
Notifications
You must be signed in to change notification settings - Fork 350
Expand file tree
/
Copy pathgenerate_Robotics_Academy_Database.yml
More file actions
108 lines (102 loc) · 3.37 KB
/
generate_Robotics_Academy_Database.yml
File metadata and controls
108 lines (102 loc) · 3.37 KB
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
# Generates and uploads an image of Robotics Academy database using the desired tag and branches
name: Generate tagged Robotics Academy Database 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
RA:
description: 'Branch of RoboticsAcademy'
required: true
default: humble-devel
type: string
RI:
description: 'Branch of Robotics Infrastructure for Universes Database'
required: true
default: database
type: string
academy_owner:
description: 'GitHub owner for RoboticsAcademy'
required: false
default: JdeRobot
type: string
infra_owner:
description: 'GitHub owner for RoboticsInfrastructure'
required: false
default: JdeRobot
type: string
workflow_dispatch:
inputs:
tag:
description: 'Docker Image Tag'
required: true
default: test
latest:
description: 'Upload as latest'
type: boolean
required: true
default: false
RA:
description: 'Branch of RoboticsAcademy'
required: true
default: humble-devel
RI:
description: 'Branch of Robotics Infrastructure for Universes Database'
required: true
default: database
academy_owner:
description: 'GitHub owner for RoboticsAcademy'
required: false
default: JdeRobot
infra_owner:
description: 'GitHub owner for RoboticsInfrastructure'
required: false
default: JdeRobot
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
- run: echo ${TAG}
- 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 and push RA database
run: |
cd scripts/RADI
docker build --no-cache -f Dockerfile.database \
--build-arg IMAGE_TAG=${TAG}\
--build-arg ROBOTICS_ACADEMY=${{ github.event.inputs.RA }}\
--build-arg ROBOTICS_INFRASTRUCTURE=${{ github.event.inputs.RI }} \
--build-arg ACADEMY_OWNER=${{ github.event.inputs.academy_owner }} \
--build-arg INFRA_OWNER=${{ github.event.inputs.infra_owner }} \
-t jderobot/robotics-database:${TAG} .
docker push jderobot/robotics-database:${TAG}
- name: Upload as Latest
if: ${{ inputs.latest }}
run: |
docker image tag jderobot/robotics-database:${TAG} jderobot/robotics-database:latest
docker push jderobot/robotics-database:latest