Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,20 @@ jobs:

- name: Build
run: bun run build

docker:
name: Docker (GHCR)
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: ./.github/workflows/docker-build-push.yml
Comment on lines +67 to +70
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, let's check if the file exists and get its structure
if [ -f .github/workflows/ci.yml ]; then
  echo "=== File found, examining structure ==="
  wc -l .github/workflows/ci.yml
  echo ""
  echo "=== Lines 40-75 (around backend, frontend, docker jobs) ==="
  sed -n '40,75p' .github/workflows/ci.yml
else
  echo "File not found"
fi

Repository: evstack/atlas

Length of output: 961


🏁 Script executed:

cat -n .github/workflows/ci.yml

Repository: evstack/atlas

Length of output: 2542


Gate image publishing on CI success with needs.

The docker job (lines 67-76) currently only checks the event and branch with if: github.event_name == 'push' && github.ref == 'refs/heads/main'. This condition does not enforce job dependencies. Without needs, the docker publish job can run in parallel with or independently of the backend tests (line 14) and frontend build (line 43), and will execute even if either fails. Add needs: [backend, frontend] to ensure images are only published after both jobs succeed.

Suggested fix
  docker:
    name: Docker (GHCR)
+   needs:
+     - backend
+     - frontend
    if: github.event_name == 'push' && github.ref == 'refs/heads/main'
    uses: ./.github/workflows/docker-build-push.yml
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
docker:
name: Docker (GHCR)
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: ./.github/workflows/docker-build-push.yml
docker:
name: Docker (GHCR)
needs:
- backend
- frontend
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: ./.github/workflows/docker-build-push.yml
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml around lines 67 - 70, The docker job is gated only
by an if condition and can run without waiting for other jobs; add an explicit
dependency by adding needs: [backend, frontend] to the docker job definition
(the job with name/key "docker" that uses
./.github/workflows/docker-build-push.yml) so that the Docker publish step only
runs after the backend and frontend jobs complete successfully.

secrets: inherit
permissions:
contents: read
packages: write
with:
image-tag: main
apps: |
[
{"name": "atlas-oss-indexer", "context": "backend", "dockerfile": "backend/Dockerfile", "target": "indexer"},
{"name": "atlas-oss-api", "context": "backend", "dockerfile": "backend/Dockerfile", "target": "api"},
{"name": "atlas-oss-frontend", "context": "frontend", "dockerfile": "frontend/Dockerfile", "target": ""}
]
58 changes: 58 additions & 0 deletions .github/workflows/docker-build-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Build Docker Images

on:
workflow_call:
inputs:
image-tag:
required: true
type: string
description: "Docker image tag (example: main)"
apps:
required: true
type: string
description: "JSON array of apps to build"

jobs:
build-images:
name: Build ${{ matrix.app.name }}
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
app: ${{ fromJson(inputs.apps) }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Comment on lines +29 to +30
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

cat -n .github/workflows/docker-build-push.yml

Repository: evstack/atlas

Length of output: 2187


Add QEMU setup before Docker Buildx for multi-platform builds.

The workflow attempts to build for linux/amd64,linux/arm64 (lines 47, 57) on ubuntu-latest (x86_64), but there is no QEMU emulation configured. Without docker/setup-qemu-action, arm64 builds will fail on the runner.

Suggested fix
      - name: Checkout
        uses: actions/checkout@v4

+      - name: Set up QEMU
+        uses: docker/setup-qemu-action@v3
+
       - name: Set up Docker Buildx
         uses: docker/setup-buildx-action@v3
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/docker-build-push.yml around lines 29 - 30, The workflow
is missing QEMU emulation which breaks multi-arch builds; add a step using
docker/setup-qemu-action (e.g., uses: docker/setup-qemu-action@v2) immediately
before the "Set up Docker Buildx" step so the runner can emulate arm64 when
building the linux/amd64,linux/arm64 targets on ubuntu-latest; ensure the new
step runs on the same job and is positioned before
docker/setup-buildx-action@v3.


- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push ${{ matrix.app.name }} (targeted)
if: matrix.app.target != ''
uses: docker/build-push-action@v6
with:
context: ${{ matrix.app.context }}
file: ${{ matrix.app.dockerfile }}
target: ${{ matrix.app.target }}
push: true
platforms: linux/amd64
tags: ghcr.io/${{ github.repository_owner }}/${{ matrix.app.name }}:${{ inputs.image-tag }}

- name: Build and push ${{ matrix.app.name }} (default target)
if: matrix.app.target == ''
uses: docker/build-push-action@v6
with:
context: ${{ matrix.app.context }}
file: ${{ matrix.app.dockerfile }}
push: true
platforms: linux/amd64
tags: ghcr.io/${{ github.repository_owner }}/${{ matrix.app.name }}:${{ inputs.image-tag }}