mirror of
https://github.com/johndoe6345789/SparkOS.git
synced 2026-04-24 13:34:56 +00:00
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:
22
.github/workflows/docker-publish.yml
vendored
22
.github/workflows/docker-publish.yml
vendored
@@ -58,8 +58,8 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
push: false
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
load: true
|
load: ${{ github.event_name == 'pull_request' }}
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
@@ -72,6 +72,12 @@ jobs:
|
|||||||
IMAGE_TAG=$(echo "${{ steps.meta.outputs.tags }}" | head -n1)
|
IMAGE_TAG=$(echo "${{ steps.meta.outputs.tags }}" | head -n1)
|
||||||
echo "Using image: $IMAGE_TAG"
|
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
|
# Run the container and check output
|
||||||
docker run --rm "$IMAGE_TAG"
|
docker run --rm "$IMAGE_TAG"
|
||||||
|
|
||||||
@@ -80,18 +86,6 @@ jobs:
|
|||||||
|
|
||||||
echo "Docker image test completed successfully!"
|
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
|
- name: Output image details
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -42,9 +42,6 @@ RUN mkdir -p /sparkos/rootfs/bin \
|
|||||||
# Copy built init binary from builder
|
# Copy built init binary from builder
|
||||||
COPY --from=builder /build/init /sparkos/rootfs/sbin/init
|
COPY --from=builder /build/init /sparkos/rootfs/sbin/init
|
||||||
|
|
||||||
# Copy setup scripts
|
|
||||||
COPY scripts/setup_rootfs.sh /sparkos/scripts/
|
|
||||||
|
|
||||||
# Set up basic configuration files
|
# Set up basic configuration files
|
||||||
RUN echo "sparkos" > /sparkos/rootfs/etc/hostname && \
|
RUN echo "sparkos" > /sparkos/rootfs/etc/hostname && \
|
||||||
echo "127.0.0.1 localhost" > /sparkos/rootfs/etc/hosts && \
|
echo "127.0.0.1 localhost" > /sparkos/rootfs/etc/hosts && \
|
||||||
|
|||||||
Reference in New Issue
Block a user