-
Notifications
You must be signed in to change notification settings - Fork 7
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
Added actions to publish to ghcr.io #20
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe recent changes to the workflow files primarily focus on enhancing container management with additional steps for logging into the Github Container Registry (ghcr.io) using Docker. Permissions for packages have been updated to allow writing, and steps for building and pushing container images, as well as Helm charts, to Changes
Poem
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 as PR comments)
Additionally, you can add CodeRabbit Configration 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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- .github/workflows/build-release.yaml (3 hunks)
- .github/workflows/publish-chart.yml (2 hunks)
Additional comments not posted (4)
.github/workflows/publish-chart.yml (2)
18-19
: Ensure appropriate permissions for package actions.The addition of
packages: write
permission is crucial for the ability to push packages to the registry. Ensure this level of permission aligns with the principle of least privilege.
38-45
: Review of new registry login and push steps.
- Login to
ghcr.io
(line 39): The use of${{ secrets.GITHUB_TOKEN }}
for authentication is appropriate, ensuring secure access to GitHub's container registry. Ensure that theGITHUB_TOKEN
has the necessary scopes enabled.- Push Packaged Chart to
ghcr.io
(line 45): The Helm push command is correctly formatted. Verify that the repository pathoci://ghcr.io/${{ github.repository_owner }}/chart
is correctly set up inghcr.io
to receive the Helm chart.Both steps are crucial for integrating Helm chart management with GitHub's container registry and appear to be implemented correctly.
Verification successful
To ensure the repository path is correctly set up in
ghcr.io
and the environment variableGITHUB_REPOSITORY_OWNER
is correctly used, we need to examine the workflow file for the proper usage of this variable. Let's search for the usage ofGITHUB_REPOSITORY_OWNER
in the.github/workflows/publish-chart.yml
file.
To understand how the repository owner information is being handled in the workflow file, let's search for the usage of
github.repository_owner
and other relevant environment variables in the.github/workflows/publish-chart.yml
file.
Verified: The usage of
github.repository_owner
in the workflow file is correct.
- The
github.repository_owner
variable is correctly used for logging in to the registry and pushing the Helm chart.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the repository path in ghcr.io. # Test: Check if the repository path is correctly set up in ghcr.io. Expect: Correct setup confirmation. echo "Verifying repository path setup in ghcr.io for ${GITHUB_REPOSITORY_OWNER}." # Placeholder for actual verification command, which would typically be part of a CI debug log or a manual check.Length of output: 106
Script:
#!/bin/bash # Search for the usage of GITHUB_REPOSITORY_OWNER in the .github/workflows/publish-chart.yml file rg 'GITHUB_REPOSITORY_OWNER' .github/workflows/publish-chart.yml -A 5Length of output: 69
Script:
#!/bin/bash # Search for the usage of github.repository_owner and other relevant environment variables in the .github/workflows/publish-chart.yml file rg 'github.repository_owner' .github/workflows/publish-chart.yml -A 5Length of output: 462
.github/workflows/build-release.yaml (2)
75-76
: Ensure appropriate permissions for package actions.The addition of
packages: write
permission is crucial for the ability to push container images to the registry. Ensure this level of permission aligns with the principle of least privilege.
Line range hint
91-114
: Review of new Docker login and push steps toghcr.io
.
- Login to GitHub Container Registry (lines 91-96): The use of
docker/login-action@v3
with${{ secrets.GITHUB_TOKEN }}
is appropriate for secure login. Ensure that theGITHUB_TOKEN
has the necessary scopes enabled.- Build & push container image to
ghcr.io
(lines 107-114): The Docker build and push commands are correctly formatted. Verify that the environment variables and the repository pathghcr.io/${{ github.repository_owner }}/helm-charts-oci-proxy
are correctly set up inghcr.io
to receive the container image.Both steps are crucial for integrating container image management with GitHub's container registry and appear to be implemented correctly.
@tpoxa do you mind reviewing, sorry for the ping |
Please keep the separation of helm/image like in the PR, I was searching for an existing issue that solves exactly this. |
Yea, I realized that both the chart and image are in the same namespace/path... Having them separated out makes sense to me |
This is a PR to publish the helm chart and docker image to the
ghcr.io
oci repo. This will address #1 .The actions will publish the docker image to
ghcr.io/container-rec/helm-charts-oci-proxy
and the helm chart toghcr.io/container-rec/chart/helm-charts-oci-proxy
. Please advise if you would like to change those locations.