From 7cb88455cf4d9f65bff7e0412fc852188442cd4f Mon Sep 17 00:00:00 2001 From: Roger Gonzalez Date: Sat, 14 Jan 2023 12:10:19 -0300 Subject: Added build with webp files --- .gitlab-ci.yml | 2 +- build.sh | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100755 build.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f3eb96e..cc33d9f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,6 +11,6 @@ deploy: - ssh-keyscan $SSH_HOST >> ~/.ssh/known_hosts - chmod 644 ~/.ssh/known_hosts 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: - master diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..0a2010c --- /dev/null +++ b/build.sh @@ -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/ -- cgit v1.2.3