caching debug
Some checks are pending
Next.js App CI / docker (push) Waiting to run

This commit is contained in:
2025-09-15 10:26:02 +02:00
parent 3d7537c5b1
commit d38025bbf8
3 changed files with 3 additions and 40 deletions

View File

@@ -30,5 +30,5 @@ jobs:
tags: |
${{ vars.LOCAL_REGISTRY }}/${{ gitea.repository_owner }}/website:latest
${{ vars.LOCAL_REGISTRY }}/${{ gitea.repository_owner }}/website:${{ gitea.sha }}
cache-from: type=gha,scope:build-${{ gitea.ref_name }}
cache-to: type=gha,scope:build-${{ gitea.ref_name }},mode=max
cache-from: type=registry,ref=${{ vars.LOCAL_REGISTRY }}/${{ gitea.repository_owner }}/website:buildcache
cache-to: type=registry,ref=${{ vars.LOCAL_REGISTRY }}/${{ gitea.repository_owner

View File

@@ -20,9 +20,7 @@ COPY . .
# --- Asset Generation Step ---
RUN ls -la .
RUN ls -la /scripts
RUN chmod +x ./scripts/*.sh && \
./scripts/first_page_image.sh && \
./scripts/generate_webp.sh
RUN chmod +x ./scripts/*.sh && ./scripts/first_page_image.sh
# Run the build command
RUN pnpm run build

View File

@@ -1,35 +0,0 @@
#!/bin/ash
# Converts all JPG and PNG images in /public to WebP format.
PUBLIC_DIR="./public"
WEBP_QUALITY=80
# Check if cwebp command is available
if ! command -v cwebp &> /dev/null
then
echo "Error: 'cwebp' command not found. Please install the 'webp' package."
exit 1
fi
echo "Searching for images to convert to WebP in $PUBLIC_DIR..."
# Find all jpg, jpeg, and png files, and ignore node_modules just in case
find "$PUBLIC_DIR" -type f \( -name "*.jpg" -o -name "*.jpeg" -o -name "*.png" \) | while read -r img_file; do
output_webp="${img_file%.*}.webp"
# Only create the image if it doesn't already exist
if [ ! -f "$output_webp" ]; then
echo "Converting: $img_file"
cwebp -q "$WEBP_QUALITY" "$img_file" -o "$output_webp"
if [ $? -eq 0 ]; then
echo " -> Created: $output_webp"
else
echo " -> Error: Failed to create WebP for $img_file."
fi
else
echo "Skipping: $output_webp already exists."
fi
done
echo "WebP conversion finished."