-
Notifications
You must be signed in to change notification settings - Fork 61k
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
flow: docker image publish with push and release #6148
base: main
Are you sure you want to change the base?
flow: docker image publish with push and release #6148
Conversation
@happyhappyhappy-arch is attempting to deploy a commit to the NextChat Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughThe changes update the GitHub Actions workflow for publishing a Docker image. A new trigger for push events on the main branch is added. The authentication credentials have been updated to use new environment variables, and the image name has been updated. Additionally, the workflow now applies dynamic tagging based on event types (push, workflow_dispatch, and release), replacing static tags. These modifications adjust both the control flow and metadata extraction processes in the workflow configuration. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant GA as GitHub Actions
participant DH as Docker Hub
User->>GA: Push commit to main branch
GA->>GA: Trigger workflow with new push event
GA->>GA: Authenticate using DOCKERHUB credentials
GA->>GA: Extract metadata and determine dynamic tags
GA->>DH: Publish Docker image with updated image name and tags
Poem
Tip 🌐 Web search-backed reviews and chat
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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
🧹 Nitpick comments (1)
.github/workflows/docker.yml (1)
25-26
: Remove Trailing Whitespace
YAMLlint has flagged trailing spaces on these lines. Removing the extra whitespace (lines 25–26) will help keep the YAML file clean and avoid linter errors.🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 25-25: trailing spaces
(trailing-spaces)
[error] 26-26: trailing spaces
(trailing-spaces)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/docker.yml
(2 hunks)
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/docker.yml
29-29: the runner of "docker/metadata-action@v4" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
🪛 YAMLlint (1.35.1)
.github/workflows/docker.yml
[error] 25-25: trailing spaces
(trailing-spaces)
[error] 26-26: trailing spaces
(trailing-spaces)
🔇 Additional comments (4)
.github/workflows/docker.yml (4)
5-7
: New Push Trigger Addition
The addition of apush
trigger for themain
branch (lines 5–7) aligns well with the PR objectives. This enables Docker image builds on code updates and ensures that nightly images are tagged appropriately.
23-24
: Updated Authentication Credentials
The credentials have been updated to useDOCKERHUB_USERNAME
andDOCKERHUB_TOKEN
, which improves security through clearer secret management. This change matches the new environment variable naming convention.
31-36
: Dynamic Tagging & Image Name Update
The image name has been updated todiota/chatgpt-next-web
and dynamic tagging conditions have been introduced for different event types. Note that the use ofworkflow_dispatch
in both the push-related and release-related conditions will cause all tags to be applied when manually triggered. Please confirm that this behavior is intended.
29-29
: Consider Upgradingdocker/metadata-action
Version
Static analysis indicates that usingdocker/metadata-action@v4
(line 29) might be problematic due to potential compatibility issues. It’s worth verifying if a more recent version is available and upgrading accordingly to benefit from bug fixes and performance improvements.🧰 Tools
🪛 actionlint (1.7.4)
29-29: the runner of "docker/metadata-action@v4" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
💻 变更类型 | Change Type
🔀 变更说明 | Description of Change
原有的github flow docker image发布与release绑定,而现今代码更新速度远超过release发布频率。
更新的的flow中,令手动触发、main的push和release发布均会触发docker image build,并根据事件发布不同的标签:
nigntly
和 commit hash(例如sha-4ba3557
)目前根据我的docker hub进行了实验,效果请参考这里
📝 补充信息 | Additional Information
出于实验目的,提交的pr中的仓库改为了我的个人仓库,如果这个pr的思路可以接受的话,后续将再次commit变更为旧有仓库。
Summary by CodeRabbit