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: デプロイ関連のワークフローを追加 #3

Merged
merged 2 commits into from
Jun 18, 2024

Conversation

tatsutakein
Copy link
Member

@tatsutakein tatsutakein commented Jun 18, 2024

Issue

概要

デプロイ関連のワークフローを追加します。

レビュー観点

レビューレベル

  • Lv0: まったく見ないで Approve する
  • Lv1: ぱっとみて違和感がないかチェックして Approve する
  • Lv2: 仕様レベルまで理解して、仕様通りに動くかある程度検証して Approve する
  • Lv3: 実際に環境で動作確認したうえで Approve する

レビュー優先度

  • すぐに見てもらいたい ( hotfix など ) 🚀
  • 今日中に見てもらいたい 🚗
  • 今日〜明日中で見てもらいたい 🚶
  • 数日以内で見てもらいたい 🐢

参考リンク

スクリーンショット

Before After

Summary by CodeRabbit

  • New Features

    • Introduced workflows for previewing changes on pull requests and deploying to production on Cloudflare Pages.
  • Enhancements

    • Updated deployment workflow parameters for improved flexibility and added support for deployment comments on pull requests.
  • Chores

    • Replaced the release job with a deploy job in the continuous deployment workflow.
    • Added new GitHub Actions workflow files for better integration and deployment processes.

Copy link

coderabbitai bot commented Jun 18, 2024

Walkthrough

The GitHub Actions workflows have been significantly updated to enhance deployment and preview capabilities for the project. These changes include the introduction of new workflows like production.yml and preview.yml, modifications to existing workflows such as cd.yml and wc-changed.yml, and the addition of a new deployment setup specifically for Cloudflare Pages using the wc-deploy-cloudflare-pages.yml file.

Changes

Files Change Summary
.github/workflows/cd.yml Replaced the release job with deploy, now using wc-deploy-cloudflare-pages.yml, and introduced additional parameters and secrets.
.github/workflows/preview.yml Introduced a new workflow for previewing changes on pull requests, handling changed files, and deploying to Cloudflare Pages.
.github/workflows/production.yml Introduced a new workflow for deploying 'asis-quest' to Cloudflare Pages, triggered on tag pushes and manual dispatches.
.github/workflows/wc-changed.yml Added website output variable, updated permissions, and expanded filters to include specific website-related files.
.github/workflows/wc-deploy-cloudflare-pages.yml Introduced a new workflow for deploying to Cloudflare Pages, including steps for code checkout, dependency installation, build, GitHub App token creation, publishing, and Lighthouse checks.

Sequence Diagram(s)

sequenceDiagram
    actor Developer
    participant GitHub_Actions as GitHub Actions
    participant Cloudflare as Cloudflare Pages

    Developer->>GitHub_Actions: Push to repository or PR opened
    GitHub_Actions->>GitHub_Actions: Trigger appropriate workflow
    GitHub_Actions->>GitHub_Actions: Checkout code, install dependencies, and build
    GitHub_Actions->>GitHub_Actions: Create GitHub App token and gather secrets
    GitHub_Actions->>Cloudflare: Deploy site to Cloudflare Pages
    GitHub_Actions->>Developer: Notify success or failure
Loading

Assessment against linked issues

Objective (Issue Number) Addressed Explanation
Add deployment workflows (#2)

Poem

In the world of code, we deploy with ease,
To Cloudflare Pages, our project to please.
Workflows refined, secrets to share,
With each push and pull, we're prepared.
Onward we build, with actions so spry,
A seamless deploy, let out a cheer—oh my!

🐇✨


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.

@tatsutakein tatsutakein merged commit 52a469f into main Jun 18, 2024
8 checks passed
@tatsutakein tatsutakein deleted the feature/GH-2 branch June 18, 2024 04:13
Copy link

@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 3734991 and 8067a40.

Files selected for processing (5)
  • .github/workflows/cd.yml (1 hunks)
  • .github/workflows/preview.yml (1 hunks)
  • .github/workflows/production.yml (1 hunks)
  • .github/workflows/wc-changed.yml (3 hunks)
  • .github/workflows/wc-deploy-cloudflare-pages.yml (1 hunks)
Files skipped from review due to trivial changes (1)
  • .github/workflows/wc-changed.yml
Additional comments not posted (6)
.github/workflows/cd.yml (3)

13-22: The deploy job is well-defined with appropriate parameters and secrets for deployment to Cloudflare Pages. Ensure that the secrets and parameters are securely managed and correctly configured in the GitHub repository settings.


16-22: The configuration of inputs and secrets looks correct. Double-check that all secrets (CLOUDFLARE_ACCOUNT_ID, CLOUDFLARE_API_TOKEN, BOT_PRIVATE_KEY) are properly set up in the GitHub secrets to avoid deployment failures.


14-14: Using an external workflow (wc-deploy-cloudflare-pages.yml) helps maintain modularity and reusability. Verify that this workflow file is correctly set up and tested.

Verification successful

The script executed successfully but did not return any output, indicating that the wc-deploy-cloudflare-pages.yml file might not exist in the repository. To confirm this, I need to search for the file without attempting to display its contents. This will help us verify if the file is indeed missing or if there was an issue with the initial search.


The second script also did not return any output, reinforcing the likelihood that the wc-deploy-cloudflare-pages.yml file does not exist. To further investigate, I will search for any YAML files in the .github/workflows directory to see if the file might be named differently or misplaced.


The previous script failed due to an incorrect search pattern. I will correct the search pattern to properly list all YAML files in the .github/workflows directory.


The wc-deploy-cloudflare-pages.yml file does exist in the .github/workflows directory. This confirms that the workflow file is present and can be used as referenced.

  • .github/workflows/wc-deploy-cloudflare-pages.yml
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the existence and correctness of the referenced workflow file.
fd 'wc-deploy-cloudflare-pages.yml' --exec cat {}

Length of output: 51



Script:

#!/bin/bash
# Description: Search for the existence of the wc-deploy-cloudflare-pages.yml file.
fd 'wc-deploy-cloudflare-pages.yml'

Length of output: 35



Script:

#!/bin/bash
# Description: List all YAML files in the .github/workflows directory to identify potential issues.
fd -e yml -e yaml .github/workflows

Length of output: 411



Script:

#!/bin/bash
# Description: List all YAML files in the .github/workflows directory using the corrected search pattern.
fd . --full-path '.github/workflows' -e yml -e yaml

Length of output: 418

.github/workflows/production.yml (1)

1-24: The configuration for production deployment is appropriately set up with triggers on version tags and manual dispatches, ensuring controlled deployments. The use of the same external workflow (wc-deploy-cloudflare-pages.yml) as in the CD workflow maintains consistency across environments.

.github/workflows/preview.yml (1)

1-26: The preview workflow is well-structured with a dependency on the changed job to conditionally deploy previews. This approach optimizes resource usage by only deploying when necessary. Ensure that the changed job correctly identifies changes relevant to the website.

Verification successful

The wc-changed.yml workflow correctly identifies changes in relevant paths for the website, ensuring the preview job only runs when necessary.

  • .github/workflows/wc-changed.yml:
    • Uses dorny/paths-filter to check for changes in paths related to the website.
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the `changed` job setup in the `preview.yml` workflow.
fd 'preview.yml' --exec cat {}

Length of output: 32



Script:

#!/bin/bash
# List all files in the `.github/workflows` directory to verify the presence of `preview.yml`.
fd . -t f -d 3 -p .github/workflows

Length of output: 404



Script:

#!/bin/bash
# Read the contents of `preview.yml` to verify the `changed` job setup.
cat .github/workflows/preview.yml

Length of output: 689



Script:

#!/bin/bash
# Read the contents of `wc-changed.yml` to verify the `changed` job implementation.
cat .github/workflows/wc-changed.yml

Length of output: 1139

.github/workflows/wc-deploy-cloudflare-pages.yml (1)

1-76: The wc-deploy-cloudflare-pages.yml workflow is comprehensive, covering all necessary steps from code checkout to deployment and performance checks with Lighthouse. The use of pinned action versions enhances security by preventing unexpected changes from newer versions. Ensure all inputs and secrets are correctly utilized in the steps and that the permissions are appropriately scoped.

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.

[Feature]: デプロイワークフローを追加
1 participant