ci(packaging): seed the container build caches from main (#28859)

* ci(packaging): seed the container build caches from main

The workflow only ran on pull requests, tags and manual dispatch, so
nothing ever saved a cache under main. Pull requests can only read
their own ref and main, so every first run on a PR built all images
cold (30 min vs 13 min warm). Running on main and weekly gives PRs a
cache to fall back to; the weekly run also keeps it inside the runner
cache's 10-day expiry.

The ROS ccache fallback also skipped the image name, so sih and gazebo
could restore each other's cache.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>

* ci(packaging): clarify why main is rebuilt weekly

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>

---------

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
This commit is contained in:
Ramon Roche authored and GitHub committed 2026-09-26 14:27:05 -07:00
1 parent 55a577ffd0
commit a4b722d400
1 file changed
+11 -3
+11 -3
View File
@@ -2,9 +2,9 @@ name: SITL Packages and Containers
on:
push:
branches: [main]
tags: ['v*']
pull_request:
paths:
paths: &container_paths
- 'cmake/package.cmake'
- 'platforms/posix/CMakeLists.txt'
- 'Tools/packaging/**'
@@ -14,6 +14,12 @@ on:
- 'boards/px4/sitl/sih.px4board'
- '.github/workflows/build_deb_package.yml'
- '.github/actions/build-deb/**'
pull_request:
paths: *container_paths
schedule:
# RunsOn deletes cache files 10 days after they are saved, even if still
# in use. Rebuild main weekly so pull requests always have a cache to reuse.
- cron: '0 6 * * 1'
workflow_dispatch:
inputs:
deploy_containers:
@@ -176,7 +182,9 @@ jobs:
with:
path: ros-ccache
key: ros-ccache-${{ matrix.arch }}-${{ matrix.image }}-${{ github.sha }}
restore-keys: ros-ccache-${{ matrix.arch }}-
restore-keys: |
ros-ccache-${{ matrix.arch }}-${{ matrix.image }}-
ros-ccache-${{ matrix.arch }}-
- name: Reuse compiler cache across image layers
uses: reproducible-containers/buildkit-cache-dance@v3