From 6896087c21b3137b1ffa10c5d662afd2bd258c8e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 28 Dec 2025 16:20:36 +0000 Subject: [PATCH] Address code review feedback: remove unused script and optimize workflow Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com> --- .github/workflows/docker-publish.yml | 22 ++++++++-------------- Dockerfile | 3 --- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 1728705..874cb24 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -58,8 +58,8 @@ jobs: with: context: . file: ./Dockerfile - push: false - load: true + push: ${{ github.event_name != 'pull_request' }} + load: ${{ github.event_name == 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha @@ -72,6 +72,12 @@ jobs: IMAGE_TAG=$(echo "${{ steps.meta.outputs.tags }}" | head -n1) echo "Using image: $IMAGE_TAG" + # For PRs, image is loaded locally; for branches, pull from GHCR + if [ "${{ github.event_name }}" != "pull_request" ]; then + echo "Pulling image from GHCR for testing..." + docker pull "$IMAGE_TAG" + fi + # Run the container and check output docker run --rm "$IMAGE_TAG" @@ -80,18 +86,6 @@ jobs: echo "Docker image test completed successfully!" - - name: Push Docker image to GHCR - if: github.event_name != 'pull_request' - uses: docker/build-push-action@v5 - with: - context: . - file: ./Dockerfile - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - cache-from: type=gha - cache-to: type=gha,mode=max - - name: Output image details if: github.event_name != 'pull_request' run: | diff --git a/Dockerfile b/Dockerfile index 05bbe84..abc6629 100644 --- a/Dockerfile +++ b/Dockerfile @@ -42,9 +42,6 @@ RUN mkdir -p /sparkos/rootfs/bin \ # Copy built init binary from builder COPY --from=builder /build/init /sparkos/rootfs/sbin/init -# Copy setup scripts -COPY scripts/setup_rootfs.sh /sparkos/scripts/ - # Set up basic configuration files RUN echo "sparkos" > /sparkos/rootfs/etc/hostname && \ echo "127.0.0.1 localhost" > /sparkos/rootfs/etc/hosts && \