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

test(ci): add deploy status badge to readme and add build ci #1738

Merged
merged 1 commit into from
Sep 27, 2024

Conversation

MSevey
Copy link
Member

@MSevey MSevey commented Sep 27, 2024

Overview

Currently there is no branch protect from a CI perspective. This PR as the build stage without deployment so that it can run on all PRs and be require to merge.
Additionally this adds the deploy status badge to the README for visibility if it were to fail.

Summary by CodeRabbit

  • New Features

    • Introduced a GitHub Actions workflow to automate the build process for the VitePress site.
    • Added a deployment status badge to the README for enhanced visibility of the deployment process.
  • Documentation

    • Updated the README.md to include the new deployment status badge.

Copy link
Contributor

coderabbitai bot commented Sep 27, 2024

Walkthrough

A new GitHub Actions workflow file named build.yml has been added to automate the build process for a VitePress site. This workflow is triggered by pushes to the main branch and pull requests, ensuring continuous integration. Additionally, the README.md file has been updated to include a badge that displays the deployment status from GitHub Actions, enhancing visibility of the deployment process.

Changes

Files Change Summary
.github/workflows/build.yml New workflow added to automate the build process for a VitePress site.
README.md Added a badge for deployment status to enhance visibility of the deployment process.

Poem

In the garden where code does bloom,
A workflow's added, dispelling the gloom.
With builds that run on every push,
And badges bright, we’ll never hush!
Hopping along, our progress we cheer,
For every change brings us near! 🐇✨


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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 using 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.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration 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.

@MSevey
Copy link
Member Author

MSevey commented Sep 27, 2024

If approved, I'll merge so that at the same time i can update the branch protection rules to require the new build CI.

Copy link
Contributor

PR Preview Action v1.4.8
🚀 Deployed preview to https://celestiaorg.github.io/docs-preview/./pr-1738/
on branch main at 2024-09-27 17:28 UTC

@MSevey MSevey requested a review from jcstein September 27, 2024 17:29
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

🧹 Outside diff range and nitpick comments (3)
.github/workflows/build.yml (3)

1-6: LGTM! Consider specifying branches for pull requests.

The workflow name is clear and descriptive. The trigger events align well with the PR objectives of running the build on all PRs and pushes to the main branch.

Consider specifying the branches for pull requests to ensure the workflow runs only when necessary. You can add this under the pull_request event:

pull_request:
  branches: [main]

This ensures the workflow runs on PRs targeting the main branch, which is typically the desired behavior.


8-10: LGTM! Consider pinning the Ubuntu version.

The job configuration is appropriate, with a concise name and using the latest Ubuntu.

To ensure consistency across builds, consider pinning the Ubuntu version:

runs-on: ubuntu-22.04

This prevents potential issues if a new Ubuntu version is released with breaking changes.


21-22: LGTM! Consider adding post-build steps.

The build step correctly uses "yarn build" for a VitePress site.

Consider adding the following improvements:

  1. Verify the build output, e.g., check if the output directory exists.
  2. Upload the build artifacts for potential use in deployment or verification.

Here's an example of how you could implement these suggestions:

- name: Build with VitePress
  run: yarn build
- name: Verify build output
  run: |
    if [ ! -d ".vitepress/dist" ]; then
      echo "Build output directory not found"
      exit 1
    fi
- name: Upload build artifacts
  uses: actions/upload-artifact@v3
  with:
    name: dist
    path: .vitepress/dist

These additions will help ensure the build process is successful and make the artifacts available for further use if needed.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 53be76f and a616a86.

📒 Files selected for processing (2)
  • .github/workflows/build.yml (1 hunks)
  • README.md (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • README.md
🔇 Additional comments (2)
.github/workflows/build.yml (2)

12-20: LGTM! Environment setup looks solid.

The environment setup steps are well-configured:

  • Using the latest major versions of actions/checkout and actions/setup-node.
  • Node.js version is pinned to 18 for consistency.
  • Yarn caching is enabled for better performance.
  • Dependency installation uses Yarn, consistent with the caching strategy.

1-22: Overall implementation looks good, but deploy status badge is missing.

The workflow successfully implements a build stage that runs on all PRs, aligning with the main PR objective. It provides a solid foundation for CI with room for minor improvements (as suggested in previous comments).

However, the PR objective of adding a deploy status badge to the README is not addressed in this workflow. To verify if this has been implemented elsewhere, let's check the README file:

If the above command doesn't return any results, consider adding the deploy status badge to the README as mentioned in the PR objectives.

Copy link
Member

@jcstein jcstein left a comment

Choose a reason for hiding this comment

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

Thank you! Resolves #1739

@jcstein jcstein merged commit 506aa9a into main Sep 27, 2024
6 checks passed
@jcstein jcstein deleted the add-build-ci branch September 27, 2024 18:01
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.

2 participants