Skip to content

Create docker.yml#77

Merged
Dargon789 merged 1 commit intomasterfrom
Dargon789-patch-2
Nov 9, 2025
Merged

Create docker.yml#77
Dargon789 merged 1 commit intomasterfrom
Dargon789-patch-2

Conversation

@Dargon789
Copy link
Owner

@Dargon789 Dargon789 commented Nov 9, 2025

Summary by Sourcery

Introduce a GitHub Actions workflow to automatically build, push, and sign Docker images

New Features:

  • Trigger automated Docker builds on a cron schedule, master branch pushes, semver tags, and pull requests
  • Build and push multi-platform Docker images with BuildKit and GitHub Actions caching
  • Sign published Docker image digests using Cosign for provenance

Enhancements:

  • Extract Docker metadata for dynamic tagging and labeling
  • Log into GHCR for image publishing except during pull request runs

CI:

  • Add .github/workflows/docker.yml to define the Docker build, push, and signing pipeline

Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com>
@gemini-code-assist
Copy link

Note

Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported.

@sourcery-ai
Copy link

sourcery-ai bot commented Nov 9, 2025

Reviewer's Guide

Introduces a new GitHub Actions workflow for building, tagging, pushing, and signing Docker images on a schedule, push events, and pull requests using Docker Buildx, metadata-action, and sigstore cosign.

Sequence diagram for Docker image build and publish process in GitHub Actions

sequenceDiagram
  participant GitHub as "GitHub Event"
  participant Actions as "GitHub Actions Workflow"
  participant Docker as "Docker Buildx"
  participant Registry as "Docker Registry (ghcr.io)"
  participant Cosign as "Sigstore Cosign"
  GitHub->>Actions: Trigger workflow (push, PR, schedule)
  Actions->>Actions: Checkout repository
  Actions->>Docker: Build Docker image
  Docker->>Actions: Return built image
  Actions->>Registry: Push image (if not PR)
  Actions->>Cosign: Sign image (if not PR)
  Cosign->>Registry: Store signature
Loading

Flow diagram for Docker image build and signing steps

flowchart TD
  A["Checkout repository"] --> B["Install cosign (if not PR)"]
  B --> C["Set up Docker Buildx"]
  C --> D["Log into registry (if not PR)"]
  D --> E["Extract Docker metadata"]
  E --> F["Build and push Docker image"]
  F --> G["Sign Docker image (if not PR)"]
Loading

File-Level Changes

Change Details Files
Configure workflow triggers, environment variables, and permissions
  • Define on.schedule, on.push (master & semver tags), and on.pull_request triggers
  • Set REGISTRY and IMAGE_NAME environment variables
  • Grant contents, packages (write), and id-token permissions
.github/workflows/docker.yml
Establish build and publish pipeline with Buildx and caching
  • Checkout repository code
  • Set up Docker Buildx for multi-platform builds
  • Login to registry using docker/login-action (skip in PRs)
  • Extract image tags and labels via metadata-action
  • Build and push images with cache-from and cache-to settings
.github/workflows/docker.yml
Integrate sigstore cosign for container signing
  • Install cosign conditionally (skip in PRs)
  • Use id-token to obtain ephemeral signing certificate
  • Sign the pushed image digest using cosign
.github/workflows/docker.yml

Possibly linked issues

  • Circleci project setup #19: The PR creates the .github/workflows/docker.yml file, implementing the GitHub Actions workflow for Docker Image CI mentioned in the issue.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@snyk-io
Copy link

snyk-io bot commented Nov 9, 2025

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes and found some issues that need to be addressed.

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location> `.github/workflows/docker.yml:26-28` </location>
<code_context>
+
+
+jobs:
+  build:
+    - name: Build the Docker image
+      run: docker build . --file path/to/Dockerfile --tag my-image-name:$(date +%s)
+
+  runs-on: ubuntu-latest
</code_context>

<issue_to_address>
**issue (bug_risk):** The 'build' job is incorrectly defined as a step, not a job.

The current structure will prevent the workflow from running. Please define 'build' as a job with 'runs-on' and 'steps' fields to ensure correct parsing.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@Dargon789 Dargon789 merged commit 324c079 into master Nov 9, 2025
14 of 16 checks passed
@Dargon789 Dargon789 deleted the Dargon789-patch-2 branch November 9, 2025 23:45
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