diff options
author | Roger Gonzalez <roger@rogs.me> | 2023-01-14 12:10:19 -0300 |
---|---|---|
committer | Roger Gonzalez <roger@rogs.me> | 2023-01-14 12:10:19 -0300 |
commit | 7cb88455cf4d9f65bff7e0412fc852188442cd4f (patch) | |
tree | b34d7b16a244a936f9391a644d599ee4801290b5 | |
parent | 38473772d87eade12fca3a0ebf78fddb376c01c2 (diff) |
Added build with webp files
-rw-r--r-- | .gitlab-ci.yml | 2 | ||||
-rwxr-xr-x | build.sh | 6 |
2 files changed, 7 insertions, 1 deletions
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/ |