mirror of
https://github.com/gilbN/theme.park.git
synced 2024-09-11 19:32:24 +02:00
new minify step
This commit is contained in:
parent
10f5ad90ee
commit
1540a9b01b
28
.github/workflows/minify-and-deploy.yml
vendored
28
.github/workflows/minify-and-deploy.yml
vendored
@ -17,13 +17,29 @@ jobs:
|
|||||||
echo "Game over man!"
|
echo "Game over man!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
- uses: actions/checkout@v2
|
- name: Minify CSS
|
||||||
|
run: |
|
||||||
|
sudo npm install -g minify
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get -y install moreutils
|
||||||
|
|
||||||
#- name: Auto Minify
|
minify_file(){
|
||||||
# uses: nizarmah/auto-minify@master
|
directory=$1
|
||||||
|
basename=$(basename $directory);
|
||||||
#- name: Remove .min suffix from minified files
|
extension="${basename##*.}"
|
||||||
# run: find ./CSS -depth -name "*.min.*" -exec sh -c 'mv "$1" "${1%.*.*}.${1##*.}"' _ {} \;
|
output="${directory%/*}/"
|
||||||
|
filename="${basename%.*}"
|
||||||
|
output_path="${output}${filename}.${extension}"
|
||||||
|
minify ${directory} | sponge ${output_path}
|
||||||
|
echo "Minified ${directory} > ${output_path}"
|
||||||
|
}
|
||||||
|
|
||||||
|
find ./CSS -type f -iname *base.css | while read fname
|
||||||
|
do
|
||||||
|
if [[ "$fname" != *"min."* ]]; then
|
||||||
|
minify_file $fname
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
uses: peaceiris/actions-gh-pages@v3
|
uses: peaceiris/actions-gh-pages@v3
|
||||||
|
Loading…
Reference in New Issue
Block a user