ci: rebuild branch containers on a schedule

The rootfs, sdk and imagebuilder containers for the release branches
are only rebuilt when someone triggers containers.yml by hand. The
-openwrt-24.10 tags on Docker Hub were last pushed in December 2025
with kernel 6.6.119 baked in, while the 24.10-SNAPSHOT feeds have
moved on to 6.6.151, so every runtime test in the packages CI fails
with a 404 on the kmods feed.

Add a schedule trigger: a scheduled run only dispatches the workflow
for main and the maintained release branches and skips the build
jobs. Going through workflow_dispatch keeps scheduled runs identical
to manual ones, since a schedule event carries no ref input and the
rest of the workflow is driven by it. GITHUB_TOKEN may create
workflow_dispatch events, so no extra secrets are needed.
pull/158/head
Josef Schlehofer 2026-08-17 09:48:57 +02:00 committed by Paul Spooren
parent ed4440d510
commit 09ba01ec8a
1 changed files with 20 additions and 0 deletions

View File

@ -11,6 +11,10 @@ env:
on: on:
# push: # push:
pull_request: pull_request:
schedule:
# Rebuild the branch containers weekly so they do not drift away
# from the published feeds; see the dispatch job below.
- cron: "30 2 * * 1"
workflow_dispatch: workflow_dispatch:
inputs: inputs:
ref: ref:
@ -28,9 +32,25 @@ on:
required: false required: false
jobs: jobs:
dispatch-scheduled-rebuilds:
name: Dispatch scheduled rebuilds
runs-on: ubuntu-latest
if: github.event_name == 'schedule'
permissions:
actions: write
steps:
- name: Trigger a run for each maintained branch
run: |
for ref in main openwrt-24.10 openwrt-25.12; do
gh workflow run containers.yml --repo "$GITHUB_REPOSITORY" -f ref="$ref"
done
env:
GH_TOKEN: ${{ github.token }}
generate_matrix: generate_matrix:
name: Set matrix name: Set matrix
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.event_name != 'schedule'
outputs: outputs:
imagebuilders: ${{ steps.find_targets.outputs.imagebuilders }} imagebuilders: ${{ steps.find_targets.outputs.imagebuilders }}