mirror of
https://github.com/gilbN/theme.park.git
synced 2024-11-04 10:12:31 +01:00
new minify step
This commit is contained in:
parent
10f5ad90ee
commit
1540a9b01b
26
.github/workflows/minify-and-deploy.yml
vendored
26
.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);
|
||||||
|
extension="${basename##*.}"
|
||||||
|
output="${directory%/*}/"
|
||||||
|
filename="${basename%.*}"
|
||||||
|
output_path="${output}${filename}.${extension}"
|
||||||
|
minify ${directory} | sponge ${output_path}
|
||||||
|
echo "Minified ${directory} > ${output_path}"
|
||||||
|
}
|
||||||
|
|
||||||
#- name: Remove .min suffix from minified files
|
find ./CSS -type f -iname *base.css | while read fname
|
||||||
# run: find ./CSS -depth -name "*.min.*" -exec sh -c 'mv "$1" "${1%.*.*}.${1##*.}"' _ {} \;
|
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