Address code review feedback: remove unused script and optimize workflow

Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-12-28 16:20:36 +00:00
parent 9d505158bb
commit 6896087c21
2 changed files with 8 additions and 17 deletions

View File

@@ -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: |

View File

@@ -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 && \