From f2948eeebebe256338ef1b6ef27ef29617dc1f94 Mon Sep 17 00:00:00 2001 From: sherl Date: Tue, 20 Jan 2026 22:14:03 +0100 Subject: [PATCH] fix: workaround npm multi-platform build bug rolls back build CI/CD to ARM64-only --- .gitea/workflows/01_docker.yaml | 39 ++++++++++++--------------------- Dockerfile | 3 +++ 2 files changed, 17 insertions(+), 25 deletions(-) diff --git a/.gitea/workflows/01_docker.yaml b/.gitea/workflows/01_docker.yaml index a760591..e0f4a6d 100644 --- a/.gitea/workflows/01_docker.yaml +++ b/.gitea/workflows/01_docker.yaml @@ -17,12 +17,6 @@ jobs: - name: Checkout repository 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 - - name: Login to registry uses: docker/login-action@v2 with: @@ -30,28 +24,23 @@ jobs: username: ${{ secrets.REGISTRY_USER }} password: ${{ secrets.REGISTRY_PASSWORD }} - - name: Set outputs - id: vars + - name: Build Docker image + env: + REF_NAME: ${{ github.ref_name }} + run: | + # Build the image with the commit hash tag + docker build --build-arg BUILD_IDENTIFIER=${REF_NAME} -t gitea.7o7.cx/kittyteam/kittyfe:master-${REF_NAME} . + + # Tag the same image as "latest" + docker tag gitea.7o7.cx/kittyteam/kittyfe:master-${REF_NAME} gitea.7o7.cx/kittyteam/kittyfe:latest + + - name: Push Docker images env: BRANCH_NAME: ${{ github.ref_name }} + SHORT_HASH: ${{ github.sha }} run: | - #echo branch_name="$BRANCH_NAME" | tee -a $GITHUB_OUTPUT - #echo short_hash=$(git rev-parse --short HEAD) | tee -a $GITHUB_OUTPUT - echo current_tag=$GITHUB_REF_NAME | tee -a $GITHUB_OUTPUT - - - name: Build and push - uses: docker/build-push-action@v6 - with: - context: . - platforms: | - linux/amd64 - linux/arm64 - pull: true - push: true - # Change when working on a different branch! - tags: | - gitea.7o7.cx/kittyteam/kittyfe:${{ steps.vars.outputs.current_tag }} - gitea.7o7.cx/kittyteam/kittyfe:latest + docker push gitea.7o7.cx/kittyteam/kittyfe:master-${REF_NAME} + docker push gitea.7o7.cx/kittyteam/kittyfe:latest - name: Log out from registry if: always() diff --git a/Dockerfile b/Dockerfile index cfee532..9c98a07 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,4 +24,7 @@ USER nodejs EXPOSE 6568 +# Since we don't know user's .env ahead of time, kittyFE needs to +# rebuild itself every launch so that the changes in .env get reflected. +# This is not ideal and we're looking into possible ways to improve this. CMD ["npm", "run", "preview", "--", "--host", "0.0.0.0", "--port", "6568"]