Skip to content

ci: trigger repeater docker rebuilds when core changes#75

Open
yellowcooln wants to merge 2 commits into
pyMC-dev:devfrom
yellowcooln:trigger-repeater-docker-rebuild
Open

ci: trigger repeater docker rebuilds when core changes#75
yellowcooln wants to merge 2 commits into
pyMC-dev:devfrom
yellowcooln:trigger-repeater-docker-rebuild

Conversation

@yellowcooln
Copy link
Copy Markdown
Contributor

PR Summary

This PR adds a GitHub Actions workflow to pyMC_core that automatically triggers a pyMC_Repeater Docker image rebuild whenever pyMC_core main or dev changes.

The goal is to keep published repeater images aligned with the current core branch automatically, without requiring manual rebuilds every time pyMC_core advances.


What It Does

The new workflow runs on:

  • Pushes to main
  • Pushes to dev
  • Optional manual workflow_dispatch

When triggered, it:

  • Determines the current channel from the branch name (main or dev)

  • Selects the repeater repository to notify:

    • pyMC-dev/pyMC_Repeater
  • Sends a repository_dispatch event to the repeater repo

  • Includes:

    • channel
    • core_ref
    • Exact core_sha

This allows the repeater repo’s Docker publish workflow to rebuild the matching image channel using the exact current core commit.


Why This Is Needed

pyMC_Repeater Docker images bundle pyMC_core, but repeater images are only rebuilt when repeater CI itself runs.

Without this workflow:

  • pyMC_core can move forward
  • Repeater Docker images can remain stale
  • Users can pull a fresh repeater image tag that still contains an older core commit

This workflow closes that gap by proactively triggering repeater rebuilds whenever core changes.


File Added

  • .github/workflows/trigger-repeater-docker-rebuild.yml

Behavior

  • dev core changes trigger repeater dev rebuilds
  • main core changes trigger repeater main rebuilds
  • No manual core commit entry is required
  • Exact core commit SHAs are passed through automatically

Required Secret

This workflow requires a repository secret in the pyMC_core repo:

  • REPEATER_REPO_DISPATCH_TOKEN

The token is used to call:

POST /repos/<repeater-repo>/dispatches

Token Permissions

Recommended

Use a fine-grained GitHub Personal Access Token.

Minimum Access

Repository access to the target repeater repo with:

  • Actions:

    • Read and write
  • Contents:

    • Read-only

Classic PAT Alternative

If using a classic PAT instead:

  • repo scope is typically sufficient
  • Fine-grained tokens are still preferred

Creating the Token

On the GitHub account that owns or has access to the target repeater repo:

  1. Open GitHub Settings

  2. Go to:

    • Developer settings
  3. Open:

    • Personal access tokens
  4. Create:

    • Fine-grained token
  5. Select the target repeater repo:

    • pyMC-dev/pyMC_Repeater
  6. Grant the required permissions

  7. Copy the token

  8. Add it to the pyMC_core repo as:

    • REPEATER_REPO_DISPATCH_TOKEN

Path:

  • Settings
  • Secrets and variables
  • Actions
  • New repository secret

Important Note

This workflow only sends the dispatch event.

The repeater repo must already contain the matching repository_dispatch handler workflow on its default branch, otherwise no rebuild will occur.

The full chain requires:

  1. Repeater workflow support for repository_dispatch
  2. This core dispatch workflow
  3. REPEATER_REPO_DISPATCH_TOKEN configured in pyMC_core

Result

Once both sides are merged and the secret is configured:

  • Merging to pyMC_core/dev automatically rebuilds repeater dev
  • Merging to pyMC_core/main automatically rebuilds repeater main
  • Published repeater Docker images stay aligned with the current core branch automatically

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant