From d38025bbf8eaab6e7ed505d9b69cbe46533715f1 Mon Sep 17 00:00:00 2001 From: Steffen Illium Date: Mon, 15 Sep 2025 10:26:02 +0200 Subject: [PATCH] caching debug --- .gitea/workflows/main.yaml | 4 ++-- Dockerfile | 4 +--- scripts/generate_webp.sh | 35 ----------------------------------- 3 files changed, 3 insertions(+), 40 deletions(-) delete mode 100644 scripts/generate_webp.sh diff --git a/.gitea/workflows/main.yaml b/.gitea/workflows/main.yaml index c550a159..30bf93d3 100644 --- a/.gitea/workflows/main.yaml +++ b/.gitea/workflows/main.yaml @@ -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 \ No newline at end of file + cache-from: type=registry,ref=${{ vars.LOCAL_REGISTRY }}/${{ gitea.repository_owner }}/website:buildcache + cache-to: type=registry,ref=${{ vars.LOCAL_REGISTRY }}/${{ gitea.repository_owner \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index f9db08fb..781c5f08 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/scripts/generate_webp.sh b/scripts/generate_webp.sh deleted file mode 100644 index 6791622e..00000000 --- a/scripts/generate_webp.sh +++ /dev/null @@ -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." \ No newline at end of file