From 0d1588f58a305ef5a3d67deff2446de36b104291 Mon Sep 17 00:00:00 2001 From: xboard Date: Fri, 16 May 2025 22:43:00 +0800 Subject: [PATCH] chore: update docker-publish.yaml and Dockerfile --- .github/workflows/docker-publish.yml | 5 ++++- Dockerfile | 16 ++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index ccef8c3..ec6ae6e 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -89,7 +89,10 @@ jobs: labels: ${{ steps.meta.outputs.labels }} build-args: | BUILDKIT_INLINE_CACHE=1 - BUILDKIT_MULTI_PLATFORM=1 + BUILDKIT_MULTI_PLATFORM=1 + CACHEBUST=${{ github.sha }} + REPO_URL=https://github.com/${{ github.repository }} + BRANCH_NAME=${{ github.ref_name }} provenance: false outputs: type=registry,push=true allow: | diff --git a/Dockerfile b/Dockerfile index 6b66651..1bb8a89 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,12 +16,16 @@ WORKDIR /www COPY .docker / -# Add build argument for cache busting -ARG CACHEBUST=1 -ARG REPO_URL=https://github.com/cedar2025/Xboard -RUN git config --global --add safe.directory /www && \ - echo "Cache bust: ${CACHEBUST}" && \ - git clone --depth 1 ${REPO_URL} . +# Add build arguments +ARG CACHEBUST +ARG REPO_URL +ARG BRANCH_NAME + +RUN echo "Attempting to clone branch: ${BRANCH_NAME} from ${REPO_URL} with CACHEBUST: ${CACHEBUST}" && \ + rm -rf ./* && \ + rm -rf .git && \ + git config --global --add safe.directory /www && \ + git clone --depth 1 --branch ${BRANCH_NAME} ${REPO_URL} . COPY .docker/supervisor/supervisord.conf /etc/supervisor/conf.d/supervisord.conf