Added build with webp files

This commit is contained in:
Roger Gonzalez 2023-01-14 12:10:19 -03:00
parent 38473772d8
commit 7cb88455cf
Signed by: rogs
GPG Key ID: C7ECE9C6C36EC2E6
2 changed files with 7 additions and 1 deletions

View File

@ -11,6 +11,6 @@ deploy:
- ssh-keyscan $SSH_HOST >> ~/.ssh/known_hosts - ssh-keyscan $SSH_HOST >> ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts - chmod 644 ~/.ssh/known_hosts
script: script:
- ssh -p $SSH_PORT $SSH_USER@$SSH_HOST "cd repo && git stash && git pull --force origin master && rm -rf /var/www/rogs.me/* && hugo -s . -d /var/www/rogs.me/" - ssh -p $SSH_PORT $SSH_USER@$SSH_HOST "cd repo && git stash && git pull --force origin master && ./build.sh"
only: only:
- master - master

6
build.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
find ./ -type f -name '*.png' -not -path '*/.git/*' -exec sh -c 'cwebp -lossless $1 -o "${1%.png}.webp"' _ {} \;
find . -type f -not -path '*/.git/*' -exec sed -i -e 's/\.png/\.webp/g' {} \;
rm -rf /var/www/rogs.me/*
hugo -s . -d /var/www/rogs.me/