Skip to content

ci: publish container image to ghcr - #1

Open
davralin wants to merge 1 commit into
crosspoint-reader:mainfrom
davralin:ci/publish-ghcr-image
Open

ci: publish container image to ghcr#1
davralin wants to merge 1 commit into
crosspoint-reader:mainfrom
davralin:ci/publish-ghcr-image

Conversation

@davralin

@davralin davralin commented Aug 5, 2026

Copy link
Copy Markdown

This actually builds and publishes the container to GHCR.

Also updated the README to point to that image, and separated a development-docker-compose-setup for local development.

I also wanted to add a renovate-setup for the action and Dockerfile, but not sure if that is wanted or not - it would require installing renovate as an app for the repo first I think.

Probably would also be useful for the node-dependencies.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

No new commits to review since the last review.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4cff5a35-0664-425f-9f01-63588234d93f

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

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The CI workflow publishes Docker images to GHCR on version tags. Standard Compose uses the published image and a named volume. Development Compose builds locally. The README documents both deployment modes.

Changes

Container delivery

Layer / File(s) Summary
Publish Docker images
.github/workflows/ci.yml
Version tags trigger CI. The workflow publishes tagged and labeled Docker images to GHCR after the test and Docker jobs succeed.
Configure Compose image usage
docker-compose.yml, docker-compose.dev.yml, README.md
Standard Compose uses the published image and crosspoint-data. Development Compose builds locally, exposes port 8080, mounts crosspoint-data, and enables registration. The README documents both modes.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant GitHubActions as GitHub Actions
  participant TestJob as test job
  participant DockerJob as Docker job
  participant GHCR as GHCR
  GitHubActions->>TestJob: run tests
  GitHubActions->>DockerJob: build Docker image
  TestJob-->>GitHubActions: successful
  DockerJob-->>GitHubActions: successful
  GitHubActions->>GHCR: authenticate and push tagged image
Loading
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: publishing the container image to GHCR through CI.
Description check ✅ Passed The description accurately covers container publishing, README updates, and the separate development Docker Compose setup.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
docker-compose.dev.yml (1)

6-7: 🩺 Stability & Availability | 🔵 Trivial

Verify write access to the bind-mounted data directory.

The Dockerfile chowns /data, but this bind mount replaces that directory with the host directory. Docker can create a missing directory for -v, and host permissions then control access. The container may fail when SQLite creates /data/crosspoint.db. (docs.docker.com)

Create ./data with ownership writable by node, use a named volume, or document the required setup. Verify this path on a clean Linux host.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docker-compose.dev.yml` around lines 6 - 7, Ensure the ./data bind-mounted
directory is writable by the container’s node user, either by documenting and
enforcing the required host ownership/permissions, replacing it with a correctly
configured named volume, or adding equivalent setup. Verify SQLite can create
/data/crosspoint.db on a clean Linux host.
.github/workflows/ci.yml (1)

46-46: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Security And Privacy (CWE-522): Insufficiently Protected Credentials

Reachability: Internal · Exploitability: Moderate

Disable actions/checkout credential persistence before use.

The publish job checks out the repository under GITHUB_TOKEN default permissions with no persist-credentials: false. This leaves the token in local Git configuration before the Docker build; keep it unavailable unless a later step needs Git operations.

Proposed checkout configuration
       - uses: actions/checkout@v4
+        with:
+          persist-credentials: false
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yml at line 46, Update the publish job’s
actions/checkout@v4 step to disable credential persistence by configuring
persist-credentials as false, ensuring the GITHUB_TOKEN is not retained in local
Git configuration before the Docker build.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/ci.yml:
- Around line 9-11: Update the workflow-level permissions block to retain only
contents: read, then add packages: write under the publish job’s permissions
block. Ensure the test and docker jobs inherit no package write access while
publish retains the permissions required for publishing.
- Around line 6-7: Align the workflow trigger and published image tag behavior:
either add a push trigger for the main branch so the existing main-tag
publication path runs, or, if releases should remain versioned, update the image
references in docker-compose.yml and README.md to use the semver tag produced by
the tag-triggered workflow.

---

Nitpick comments:
In @.github/workflows/ci.yml:
- Line 46: Update the publish job’s actions/checkout@v4 step to disable
credential persistence by configuring persist-credentials as false, ensuring the
GITHUB_TOKEN is not retained in local Git configuration before the Docker build.

In `@docker-compose.dev.yml`:
- Around line 6-7: Ensure the ./data bind-mounted directory is writable by the
container’s node user, either by documenting and enforcing the required host
ownership/permissions, replacing it with a correctly configured named volume, or
adding equivalent setup. Verify SQLite can create /data/crosspoint.db on a clean
Linux host.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e28ecd2e-a1fb-4b45-a85f-fd7cc444f56c

📥 Commits

Reviewing files that changed from the base of the PR and between 067f908 and 54c43df.

📒 Files selected for processing (4)
  • .github/workflows/ci.yml
  • README.md
  • docker-compose.dev.yml
  • docker-compose.yml
📜 Review details
🧰 Additional context used
🪛 zizmor (1.29.0)
.github/workflows/ci.yml

[error] 11-11: overly broad permissions (excessive-permissions): packages: write is overly broad at the workflow level

(excessive-permissions)


[warning] 46-46: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)

🔇 Additional comments (3)
.github/workflows/ci.yml (1)

41-45: LGTM!

Also applies to: 47-58, 63-68

docker-compose.dev.yml (1)

1-5: LGTM!

Also applies to: 8-11

README.md (1)

34-38: LGTM!

Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/ci.yml Outdated
@itsthisjustin

Copy link
Copy Markdown
Contributor

Are these coderabbit suggestions valid?

@davralin
davralin force-pushed the ci/publish-ghcr-image branch from 54c43df to 7dec38c Compare August 7, 2026 08:54
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@davralin

davralin commented Aug 7, 2026

Copy link
Copy Markdown
Author

Are these coderabbit suggestions valid?

Some yes, I'll work through those.

edit:
@itsthisjustin I think it's fine now, dont know how to trigger a new run, but it seems like @CodeRabbit marked the issues as resolved.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

@davralin A new review has been requested. It will check the current pull request changes and report any remaining findings.

⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

@davralin A new review will check the current state of this pull request.

⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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