diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 9bb6927..85abbb2 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -30,8 +30,11 @@ jobs: - name: Build Frontend run: | cd ui + echo "//gitea.siegeln.net/api/packages/cameleer/npm/:_authToken=${REGISTRY_TOKEN}" >> .npmrc npm ci npm run build + env: + REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }} - name: Build and Test (unit tests only) run: >- @@ -76,15 +79,22 @@ jobs: echo "IMAGE_TAGS=branch-$SLUG" >> "$GITHUB_ENV" fi + - name: Set up QEMU for cross-platform builds + run: docker run --rm --privileged gitea.siegeln.net/cameleer/binfmt:1 --install all + - name: Build and push run: | + docker buildx create --use --name cibuilder TAGS="-t gitea.siegeln.net/cameleer/cameleer-saas:${{ github.sha }}" for TAG in $IMAGE_TAGS; do TAGS="$TAGS -t gitea.siegeln.net/cameleer/cameleer-saas:$TAG" done - docker build $TAGS --provenance=false . - for TAG in $IMAGE_TAGS ${{ github.sha }}; do - docker push gitea.siegeln.net/cameleer/cameleer-saas:$TAG - done + docker buildx build --platform linux/amd64 \ + --build-arg REGISTRY_TOKEN="$REGISTRY_TOKEN" \ + $TAGS \ + --cache-from type=registry,ref=gitea.siegeln.net/cameleer/cameleer-saas:buildcache \ + --cache-to type=registry,ref=gitea.siegeln.net/cameleer/cameleer-saas:buildcache,mode=max \ + --provenance=false \ + --push . env: REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }} diff --git a/Dockerfile b/Dockerfile index ba12871..941dddb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,9 @@ # syntax=docker/dockerfile:1 FROM node:22-alpine AS frontend +ARG REGISTRY_TOKEN WORKDIR /ui COPY ui/package.json ui/package-lock.json ui/.npmrc ./ -RUN npm ci +RUN echo "//gitea.siegeln.net/api/packages/cameleer/npm/:_authToken=${REGISTRY_TOKEN}" >> .npmrc && npm ci COPY ui/ . RUN npm run build