Skip to content

Commit 630d0d3

Browse files
committed
Use caching only for teleop_ros2 base stage in Docker build workflow
1 parent c15d8fb commit 630d0d3

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

.github/workflows/build-ubuntu.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,19 @@ jobs:
167167
- name: Set up Docker Buildx
168168
uses: docker/setup-buildx-action@v4.0.0
169169

170+
- name: Cache teleop_ros2 base stage
171+
uses: docker/build-push-action@v7
172+
with:
173+
context: .
174+
file: examples/teleop_ros2/Dockerfile
175+
target: base
176+
build-args: |
177+
ROS_DISTRO=${{ matrix.ros_distro }}
178+
PYTHON_VERSION=${{ matrix.python_version }}
179+
cache-from: type=gha,scope=teleop-ros2-base-${{ matrix.ros_distro }}-py${{ matrix.python_version }}
180+
cache-to: type=gha,mode=max,scope=teleop-ros2-base-${{ matrix.ros_distro }}-py${{ matrix.python_version }}
181+
outputs: type=cacheonly
182+
170183
- name: Build teleop_ros2 image
171184
uses: docker/build-push-action@v7
172185
with:
@@ -178,8 +191,7 @@ jobs:
178191
tags: teleop_ros2_ref:${{ matrix.ros_distro }}
179192
load: true
180193
push: false
181-
cache-from: type=gha,scope=teleop-ros2-${{ matrix.ros_distro }}
182-
cache-to: type=gha,mode=min,scope=teleop-ros2-${{ matrix.ros_distro }}
194+
cache-from: type=gha,scope=teleop-ros2-base-${{ matrix.ros_distro }}-py${{ matrix.python_version }}
183195

184196
- name: Smoke test (ROS 2 + rclpy)
185197
run: |

0 commit comments

Comments
 (0)