Skip to content

[131-3] feat: CI pipeline — build and push opencode Docker image on tag#3

Merged
andreiships-bot merged 1 commit intodevfrom
131-phase-3
Feb 18, 2026
Merged

[131-3] feat: CI pipeline — build and push opencode Docker image on tag#3
andreiships-bot merged 1 commit intodevfrom
131-phase-3

Conversation

@andreiships-bot
Copy link
Copy Markdown
Collaborator

Adds build-push.yml workflow triggered on v* tags. Builds multi-stage Dockerfile and pushes to registry.fly.io/pistachiorama-opencode. Depends on Dockerfile from PR #2.

Adds .github/workflows/build-push.yml that triggers on v* tags to:
- Build the multi-stage Dockerfile (Bun builder → Alpine runtime)
- Push to registry.fly.io/pistachiorama-opencode with version + latest tags
- Use GitHub Actions build cache for faster subsequent builds

Depends on Dockerfile from PR #2 (131-phase-2 branch).
@github-actions
Copy link
Copy Markdown

Hey! Your PR title [131-3] feat: CI pipeline — build and push opencode Docker image on tag doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@andreiships-bot andreiships-bot merged commit 5fd028c into dev Feb 18, 2026
3 of 7 checks passed
@andreiships-bot
Copy link
Copy Markdown
Collaborator Author

Claude Single-Pass Review

Summary

This PR adds a straightforward GitHub Actions workflow to build and push a Docker image to Fly.io's registry on version tag pushes. The workflow is well-structured with minimal permissions, but has two issues worth addressing: :latest is pushed on every v* tag including pre-releases, and provenance: true (the v6 default) can cause image digest resolution problems on some registries including Fly.io.

Findings

[FINDING-1] issue: P1 | .github/workflows/build-push.yml:35 | The :latest tag is pushed unconditionally on every v* tag push, including pre-releases like v1.0.0-alpha or v1.0.0-rc1. Verified via diff: registry.fly.io/pistachiorama-opencode:latest. Fix: Either omit the :latest tag entirely and let Fly.io deployments reference explicit version tags, or add a condition to only push :latest for non-pre-release tags (e.g., filter out tags containing - in the tag name using a separate step with if: !contains(steps.version.outputs.tag, '-')).

[FINDING-2] nit: P2 | .github/workflows/build-push.yml:31 | docker/build-push-action@v6 defaults to provenance: true, which generates OCI attestation manifests. On Fly.io's registry, this can cause fly deploy to resolve the wrong digest (the attestation index rather than the image manifest). Fix: Add provenance: false to the build-push step unless attestation is explicitly needed.

[FINDING-3] nit: P2 | .github/workflows/build-push.yml:31 | No platforms: specified — the image will only be built for the runner's architecture (linux/amd64 on Blacksmith). If Fly.io machines use ARM, this will silently pull the wrong arch. Fix: Add platforms: linux/amd64 (or linux/amd64,linux/arm64 for multi-arch) to make the intent explicit.

Code Quality

  • Secrets referenced via ${{ secrets.FLY_API_TOKEN }} — no secrets in code
  • Minimal permissions (contents: read) at workflow level
  • Tag extraction uses correct quoting (>> "$GITHUB_OUTPUT")
  • GHA cache configured correctly (cache-from/cache-to with mode=max)
  • issue: :latest tag pushed on all v* including pre-releases (FINDING-1)
  • nit: Missing provenance: false for Fly.io registry compatibility (FINDING-2)
  • nit: No explicit platforms: — architecture is implicit (FINDING-3)

Recommendation

[ ] Approve | [x] Approve with changes | [ ] Request changes

Copy link
Copy Markdown
Collaborator Author

@andreiships-bot andreiships-bot left a comment

Choose a reason for hiding this comment

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

Claude Review

See inline comments for details.

uses: docker/build-push-action@v6
with:
context: .
push: true
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

[FINDING-1] issue: P1 | The :latest tag is pushed unconditionally on every v* tag push, including pre-releases like v1.0.0-alpha or v1.0.0-rc1. Verified via diff: registry.fly.io/pistachiorama-opencode:latest. Fix: Either omit the :latest tag entirely and let Fly.io deployments reference explicit version tags, or add a condition to only push :latest for non-pre-release tags (e.g., filter out tags containing - in the tag name using a separate step with if: !contains(steps.version.outputs.tag, '-')).

id: version
run: echo "tag=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"

- name: Build and push
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

[FINDING-2] nit: P2 | docker/build-push-action@v6 defaults to provenance: true, which generates OCI attestation manifests. On Fly.io's registry, this can cause fly deploy to resolve the wrong digest (the attestation index rather than the image manifest). Fix: Add provenance: false to the build-push step unless attestation is explicitly needed.

id: version
run: echo "tag=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"

- name: Build and push
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

[FINDING-3] nit: P2 | No platforms: specified — the image will only be built for the runner's architecture (linux/amd64 on Blacksmith). If Fly.io machines use ARM, this will silently pull the wrong arch. Fix: Add platforms: linux/amd64 (or linux/amd64,linux/arm64 for multi-arch) to make the intent explicit.

andreiships-bot pushed a commit that referenced this pull request Feb 21, 2026
Fixes issues found during retroactive review of PRs #1, #2, #3.

tool-call.ts:
- Agent.defaultAgent() returns a name string, not Agent.Info — resolve
  with Agent.get() before passing to ToolRegistry.tools()
- Fix agent: agent.id (undefined on string) → agent: agentName
- Use agent's configured model instead of hardcoded opencode/default

Dockerfile:
- Quote $(find ...) and add existence check to prevent cryptic failures
  when binary is missing
- Remove BUN_RUNTIME_TRANSPILER_CACHE_PATH env var — irrelevant for a
  compiled native binary that does not use Bun's transpiler

fly.toml:
- min_machines_running: 0 → 1 to avoid cold starts on interactive sessions

scripts/ci/test-opencode-integration.sh:
- Replace hardcoded /tmp/ paths with mktemp tmpdir + EXIT trap to
  avoid collisions in parallel CI runs

.github/workflows/build-push.yml:
- Gate :latest push on stable tags only (no pre-release suffix like -rc1)
- Add provenance: false to prevent OCI attestation manifests from
  breaking fly deploy digest resolution
- Explicitly set platforms: linux/amd64 to avoid silent arch mismatches
andreiships-bot added a commit that referenced this pull request Feb 23, 2026
…, CI) (#4)

* fix(131): address P1 review findings from retroactive review

Fixes issues found during retroactive review of PRs #1, #2, #3.

tool-call.ts:
- Agent.defaultAgent() returns a name string, not Agent.Info — resolve
  with Agent.get() before passing to ToolRegistry.tools()
- Fix agent: agent.id (undefined on string) → agent: agentName
- Use agent's configured model instead of hardcoded opencode/default

Dockerfile:
- Quote $(find ...) and add existence check to prevent cryptic failures
  when binary is missing
- Remove BUN_RUNTIME_TRANSPILER_CACHE_PATH env var — irrelevant for a
  compiled native binary that does not use Bun's transpiler

fly.toml:
- min_machines_running: 0 → 1 to avoid cold starts on interactive sessions

scripts/ci/test-opencode-integration.sh:
- Replace hardcoded /tmp/ paths with mktemp tmpdir + EXIT trap to
  avoid collisions in parallel CI runs

.github/workflows/build-push.yml:
- Gate :latest push on stable tags only (no pre-release suffix like -rc1)
- Add provenance: false to prevent OCI attestation manifests from
  breaking fly deploy digest resolution
- Explicitly set platforms: linux/amd64 to avoid silent arch mismatches

* ci: replace blacksmith runners with ubicloud-standard-2

All blacksmith-* runner labels replaced:
- blacksmith-4vcpu-ubuntu-2404     → ubicloud-standard-2
- blacksmith-8vcpu-ubuntu-2404-arm → ubicloud-standard-8-arm
- blacksmith-4vcpu-ubuntu-2404-arm → ubicloud-standard-2-arm
- blacksmith-4vcpu-windows-2025    → windows-latest (no Ubicloud Windows runner)

---------

Co-authored-by: Andrei Cojocaru <andrei@pistachiorama.ai>
Co-authored-by: andreiships-bot <andreiships-bot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants