Skip to content

Commit

Permalink
deploy corrected
Browse files Browse the repository at this point in the history
  • Loading branch information
juanmanueldaza committed Dec 14, 2024
1 parent 704e4b0 commit 5215be5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Build
run: npm run build # Vite build happens FIRST

- name: Install ImageMagick
run: |
sudo apt-get update
Expand All @@ -32,10 +35,7 @@ jobs:
- name: Run Image Processing Script
run: |
chmod +x ./picture_processing.sh
./picture_processing.sh
- name: Build
run: npm run build
./picture_processing.sh # Now runs AFTER the build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

Expand Down
10 changes: 6 additions & 4 deletions picture_processing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

find dist/pictures -name "*.jpg" -print0 | while IFS= read -r -d $'\0' file; do
base="${file##dist/pictures/}"
convert "$file" -resize 640x "${base}-small.webp"
convert "$file" -resize 1024x "${base}-medium.webp"
convert "$file" -resize 1920x "${base}-large.webp"
cp "$file" "${base}-xlarge.jpg"
if convert "$file" -resize 640x "${file%.*}-small.webp"; then
echo "Conversion to small WebP successful: $file"
else
echo "Error converting to small WebP: $file" >&2 #Send error to stderr
fi
cp "$file" "${file%.*}-xlarge.jpg"
done

0 comments on commit 5215be5

Please sign in to comment.