Skip to content

fix(ci): improve workflow robustness, resolve registry path case issues, and pin base image - #1

Open
Piyush37-6 wants to merge 4 commits into
blender:mainfrom
Piyush37-6:main
Open

fix(ci): improve workflow robustness, resolve registry path case issues, and pin base image#1
Piyush37-6 wants to merge 4 commits into
blender:mainfrom
Piyush37-6:main

Conversation

@Piyush37-6

Copy link
Copy Markdown

CI/CD Workflows Robustness and Base Image Pinning

Summary

This pull request introduces several critical bug fixes, validation improvements, and reproducibility enhancements to the CI/CD workflows and the bpy runner image.

Specifically, it:

  1. Resolves Case-Sensitivity Issues: Lowercases the repository name in the workflow to avoid registry tag errors in GHCR (GitHub Container Registry) when the repository owner or name contains uppercase letters.
  2. Eliminates Syntax Warnings: Wraps all template expressions starting with ${{ in quotes, resolving YAML validation errors and red syntax highlights in IDEs.
  3. Prevents Overwriting :latest: Introduces a configurable push_latest parameter to prevent historical or manual release builds from overwriting the primary :latest image tag.
  4. Adds Fail-Fast Validation: Introduces an early check to ensure images/<image_name>/Dockerfile exists, preventing wasting runner minutes on builds with misspelled inputs.
  5. Ensures Reproducibility: Pins the base image in bpy/Dockerfile to a stable Ubuntu release tag (act-22.04) instead of using the rolling :act-latest tag.

Detailed Breakdown of Changes

🛠️ Workflows

  • .github/workflows/build-image.yml

    • Added a new push_latest boolean input (defaults to true).
    • Added step Lowercase repo name to safely convert the repository path (e.g., Piyush37-6/runner-images) to lowercase.
    • Added step Generate tags which builds a clean, multiline tag string (avoiding leading indentation whitespaces) and outputs it to docker_tags.
    • Wrapped credentials (username, password) and step outputs (tags) in double quotes to satisfy strict YAML parsers.
  • .github/workflows/release.yml

    • Added the push_latest input to manual triggers (workflow_dispatch).
    • Checked out the repository in the initial parse-tag job to inspect if the target image directory exists.
    • Added a fail-fast bash assertion to abort execution with a clean error annotation (::error::) if images/<image_name>/Dockerfile does not exist.
    • Wrapped all output expressions and parameters in double quotes to clean up syntax warnings.

🐳 Dockerfiles

  • images/bpy/Dockerfile
    • Changed the base image from ghcr.io/catthehacker/ubuntu:act-latest to the stable tag ghcr.io/catthehacker/ubuntu:act-22.04 to prevent upstream changes from silently breaking image builds.

🔄 Before / After Comparison

1. GHCR Registry Case Sensitivity

  • Before: Using the default ${{ github.repository }} string caused build errors if the owner/repository contained uppercase letters (e.g. Piyush37-6/runner-images).
  • After: Added a step to lowercase the repository name before using it in Docker registry tags.

Before:

tags: |
  ghcr.io/${{ github.repository }}/${{ inputs.image_name }}:${{ inputs.tag }}
  ghcr.io/${{ github.repository }}/${{ inputs.image_name }}:latest

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