Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: update cd/cd build processes for docker #22

Merged
merged 5 commits into from
Jun 19, 2024
Merged

Conversation

tankerkiller125
Copy link
Contributor

@tankerkiller125 tankerkiller125 commented Jun 19, 2024

What type of PR is this?

(REQUIRED)

  • ci/cd

What this PR does / why we need it:

(REQUIRED)

This PR should update the docker building process to work better for our workflow, and also have digest signing.

Which issue(s) this PR fixes:

(REQUIRED)

No issues associated

Summary by CodeRabbit

  • New Features

    • Introduced a new GitHub Actions workflow for publishing Docker images.
    • Added capabilities for building, pushing, and signing Docker images, ensuring secure and efficient Docker image publishing.
    • Implemented multi-platform support with Docker Buildx.
  • Chores

    • Initialized environment variables and set up necessary tools and permissions for Docker image workflows.

Copy link
Contributor

coderabbitai bot commented Jun 19, 2024

Important

Review skipped

More than 25% of the files skipped due to max files limit. The review is being skipped to prevent a low-quality review.

71 files out of 127 files are above the max files limit of 50. Please upgrade to Pro plan to get higher limits.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The introduction of docker-publish-rootless.yaml and docker-publish.yaml sets up comprehensive GitHub Actions workflows for efficient and secure Docker image publishing. These workflows automate the process of building, pushing, and signing Docker images using multiple tools, ensuring robust multi-platform support and optimized Docker image handling based on various event triggers.

Changes

File Path Change Summary
.github/workflows/docker-publish-rootless.yaml Introduced a workflow for building, pushing, and signing Docker images utilizing various actions and environment setups.
.github/workflows/docker-publish.yaml Added a complete GitHub Actions workflow for publishing Docker images, leveraging multi-platform support and secure image signing.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    actor Developer
    Developer ->> GitHub Actions: Push changes / PR / Schedule
    GitHub Actions ->> Workflow: Trigger `docker-publish.yaml` or `docker-publish-rootless.yaml`
    Workflow ->> actions/checkout: Checkout repository
    Workflow ->> cosign-installer: Install `cosign`
    Workflow ->> docker/buildx: Setup Docker Buildx
    Workflow ->> docker/login-action: Login to Docker registry
    Workflow ->> docker/metadata-action: Extract Docker metadata
    Workflow ->> docker/build-push-action: Build and push Docker image
    Workflow ->> cosign: Sign Docker image
    cosign ->> Docker Registry: Upload signed image
Loading

Poem

In the realm of code where workflows rise,
Dockers dream beneath the skies.
Automated builds with signatures bold,
Securely handled, perfectly rolled.
On each event, the actions queue,
A symphony of code—just for you.
🎵🔧🚀


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 2111ee1 and e7ae718.

Files selected for processing (2)
  • .github/workflows/docker-publish-rootless.yaml (1 hunks)
  • .github/workflows/docker-publish.yaml (1 hunks)
Additional comments not posted (8)
.github/workflows/docker-publish.yaml (4)

13-17: Environment variables are set appropriately for Docker operations. Ensure that the REGISTRY and IMAGE_NAME are configured as per your organization's policies.


21-29: The job is configured with specific permissions, which are well-suited for the tasks at hand. This includes permissions for reading contents, writing packages, and handling ID tokens, essential for operations outside of PRs.


31-94: All steps in the workflow are meticulously detailed, including conditions for running certain steps only outside of pull requests. This ensures security and control over the build and push processes. Each action uses pinned versions, enhancing the reliability and reproducibility of the workflow.


3-11: The scheduled trigger is set for daily execution at 6:38 AM UTC, which is an unusual time. Consider aligning this with a more standard time, perhaps on the hour or half-hour, unless specific reasons dictate otherwise.

.github/workflows/docker-publish-rootless.yaml (4)

3-11: The triggers are configured to activate the workflow on a daily schedule at 6:00 AM UTC, on pushes to the main branch, and on semver-tagged releases. This configuration ensures that the workflow runs regularly and in response to relevant repository events.


13-17: The environment setup mirrors that of the standard Docker publish workflow, ensuring consistency across workflows. This uniformity is beneficial for maintenance and understanding across different CI/CD configurations.


21-29: The job configuration is robust, specifying ubuntu-latest as the runner and setting precise permissions necessary for the workflow's operations. This setup is crucial for secure and efficient execution of the workflow steps.


31-95: The workflow steps are well-defined and include conditions to prevent operations such as pushing and signing during pull requests. This careful setup ensures that actions such as image signing only occur in controlled circumstances.

@tankerkiller125 tankerkiller125 merged commit c844fcd into main Jun 19, 2024
3 checks passed
@tankerkiller125 tankerkiller125 deleted the chore/new-ci-cd branch July 2, 2024 15:42
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