This commit is contained in:
Andras Bacsai 2026-03-11 03:17:20 +08:00 committed by GitHub
commit 1290c18f2a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 28 additions and 3 deletions

View file

@ -60,6 +60,9 @@ jobs:
run: |
echo "VERSION=$(docker run --rm -v "$(pwd):/app" -w /app php:8.2-alpine3.16 php bootstrap/getVersion.php)"|xargs >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and Push Image (${{ matrix.arch }})
uses: docker/build-push-action@v6
with:
@ -70,6 +73,12 @@ jobs:
tags: |
${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.VERSION }}-${{ matrix.arch }}
${{ env.GITHUB_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.VERSION }}-${{ matrix.arch }}
cache-from: |
type=gha,scope=prod-build-${{ matrix.arch }}
type=registry,ref=${{ env.GITHUB_REGISTRY }}/${{ env.IMAGE_NAME }}:prod-buildcache-${{ matrix.arch }}
cache-to: |
type=gha,mode=max,scope=prod-build-${{ matrix.arch }}
type=registry,ref=${{ env.GITHUB_REGISTRY }}/${{ env.IMAGE_NAME }}:prod-buildcache-${{ matrix.arch }},mode=max
merge-manifest:
runs-on: ubuntu-24.04

View file

@ -81,7 +81,9 @@ jobs:
cache-from: |
type=gha,scope=build-${{ matrix.arch }}
type=registry,ref=${{ env.GITHUB_REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache-${{ matrix.arch }}
cache-to: type=gha,mode=max,scope=build-${{ matrix.arch }}
cache-to: |
type=gha,mode=max,scope=build-${{ matrix.arch }}
type=registry,ref=${{ env.GITHUB_REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache-${{ matrix.arch }},mode=max
merge-manifest:
runs-on: ubuntu-24.04

View file

@ -39,10 +39,24 @@ USER www-data
FROM node:24-alpine AS static-assets
WORKDIR /app
COPY package*.json vite.config.js postcss.config.cjs ./
# Layer 1: Package dependencies (rarely changes)
COPY package*.json ./
RUN --mount=type=cache,target=/root/.npm \
npm ci
COPY . .
# Layer 2: Build config (rarely changes)
COPY vite.config.js postcss.config.cjs ./
# Layer 3: Frontend source files
COPY resources/css/ ./resources/css/
COPY resources/js/ ./resources/js/
COPY resources/fonts/ ./resources/fonts/
# Layer 4: Blade templates for Tailwind class detection
COPY resources/views/ ./resources/views/
# Build frontend assets
RUN npm run build
# =================================================================