Optimize GitHub Actions workflows for State Manager & Dashboard builds#430
Conversation
…DockerHub - merged duplicate build jobs into a single job per workflow - standardized image tagging (latest, semver, sha) - ensured tests run before publishing images - reduced CI runtime and improved maintainability
|
Note Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported. |
SafeDep Report SummaryPackage Details
This report is generated by SafeDep Github App. |
|
Caution Review failedThe pull request is closed. 📝 WalkthroughSummary by CodeRabbit
Summary by CodeRabbit
WalkthroughConsolidates publishing into a single Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Trigger as Git event / release
participant GHActions as GitHub Actions
participant Meta as docker/metadata-action
participant GHCR as ghcr.io
participant DH as docker.io
Trigger->>GHActions: trigger publish workflow
GHActions->>GHActions: checkout, setup-buildx
GHActions->>GHCR: docker login (GHCR_REGISTRY)
GHActions->>DH: docker login (DOCKER_REGISTRY)
GHActions->>Meta: generate tags/labels for both registry image refs
GHActions->>GHActions: buildx build & push (uses metadata)
GHActions->>GHCR: push image
GHActions->>DH: push image
GHActions-->>Trigger: publish-image job completes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…ating steps - Renamed job from 'publish-image-on-ghcr' to 'publish-image' for clarity. - Removed redundant Docker Hub publishing job to streamline the workflow. - Ensured consistent image publishing settings across workflows, including provenance and SBOM generation.
…figuration - Renamed environment variables for clarity, changing REGISTRY to GHCR_REGISTRY and adding DOCKER_REGISTRY. - Simplified image name handling by directly using the environment variable for both GHCR and Docker Hub. - Removed unnecessary outputs from the workflow to streamline the process.
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
.github/workflows/release-dashboard.yml (1)
48-67: GHCR tags are no longer generated or pushed
By feedingimages: ${{ env.IMAGE_NAME }}todocker/metadata-action, the build now emits tags likeexospherehost/exosphere-dashboard:latestwithout theghcr.io/prefix.docker/build-push-actiontherefore only publishes to Docker Hub, and the GHCR login step becomes a no-op. This regresses the release workflow because GHCR never receives the image. Please emit tags for both registries.- name: Generate tags & labels id: meta uses: docker/metadata-action@v5 with: - images: ${{ env.IMAGE_NAME }} + images: | + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + ${{ env.IMAGE_NAME }} tags: | type=raw,value=latest type=semver,pattern={{version}}.github/workflows/release-state-manager.yml (1)
118-125: Enable buildx GHA cache for faster repeat builds.Adds substantial speed-ups and lower CI cost without behavior change.
with: context: ./state-manager push: true platforms: linux/amd64,linux/arm64 tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha,scope=state-manager + cache-to: type=gha,mode=max,scope=state-manager provenance: true sbom: true
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/release-dashboard.yml(1 hunks).github/workflows/release-state-manager.yml(5 hunks)
🔇 Additional comments (4)
.github/workflows/release-state-manager.yml (4)
8-10: Good env factoring for registries and image name.
47-47: uv sync for dev deps is appropriate.
69-77: Consolidated publish job + minimal permissions look good.
91-93: GHCR login OK; confirm package visibility.If this is a public image, ensure the GHCR package visibility is public on first push (GHCR defaults can be private). Adjust via UI/API if needed.
| images: | | ||
| ${{ env.GHCR_REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} | ||
| ${{ env.DOCKER_REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} | ||
| tags: | |
There was a problem hiding this comment.
Enforce lowercase image names and allow Docker Hub namespace override.
Registry image names should be lowercase. Also, Docker Hub namespace may differ from github.repository_owner, causing push failures. Apply:
- images: |
- ${{ env.GHCR_REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}
- ${{ env.DOCKER_REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}
+ images: |
+ ${{ toLower(format('{0}/{1}/{2}', env.GHCR_REGISTRY, github.repository_owner, env.IMAGE_NAME)) }}
+ ${{ toLower(format('{0}/{1}/{2}', env.DOCKER_REGISTRY, env.DOCKERHUB_NAMESPACE, env.IMAGE_NAME)) }}Add this env key near the other env vars to override when needed (defaults to repo owner):
env:
GHCR_REGISTRY: ghcr.io
DOCKER_REGISTRY: docker.io
IMAGE_NAME: exosphere-state-manager
DOCKERHUB_NAMESPACE: ${{ vars.DOCKERHUB_NAMESPACE || github.repository_owner }}🤖 Prompt for AI Agents
.github/workflows/release-state-manager.yml around lines 105-108: the workflow
currently uses github.repository_owner for Docker Hub namespace and does not
guarantee lowercase image names, which can cause push failures; add a new env
key DOCKERHUB_NAMESPACE (defaulting to github.repository_owner) alongside
GHCR_REGISTRY/DOCKER_REGISTRY/IMAGE_NAME, ensure IMAGE_NAME is set to a
lowercase string, and update the images entries to use ${DOCKERHUB_NAMESPACE}
for the docker.io path (and keep GHCR_REGISTRY for ghcr) so both registry image
names use the proper namespace and lowercase image name.
What Changed
publish-image-on-ghcr&publish-image-on-docker) into a single job per workflow.