change all ttf fonts to woff2 and replace in public
parent
47c11b8fba
commit
6c9d11f035
|
|
@ -46,5 +46,5 @@ spec:
|
||||||
GITLAB_PAT: ${{ secrets.get("resume-gitlab-gitlab-breel-dev-token") }}
|
GITLAB_PAT: ${{ secrets.get("resume-gitlab-gitlab-breel-dev-token") }}
|
||||||
shell: sh
|
shell: sh
|
||||||
script: |
|
script: |
|
||||||
apt -y install git
|
apt -y install git woff2
|
||||||
bash ./deploy.firebase.sh
|
bash ./deploy.firebase.sh
|
||||||
|
|
@ -4,6 +4,7 @@ set -o pipefail
|
||||||
set -e
|
set -e
|
||||||
set -u
|
set -u
|
||||||
|
|
||||||
|
|
||||||
if tty && ! which firebase; then
|
if tty && ! which firebase; then
|
||||||
f="$(mktemp)"
|
f="$(mktemp)"
|
||||||
wget https://firebase.tools -O - > "$f"
|
wget https://firebase.tools -O - > "$f"
|
||||||
|
|
@ -24,6 +25,29 @@ cp ./open-resume.com.d/resume.html.2 $outdir/public/index.html
|
||||||
cp ./open-resume.com.d/resume.pdf $outdir/public/BreeLaPointeResume.pdf
|
cp ./open-resume.com.d/resume.pdf $outdir/public/BreeLaPointeResume.pdf
|
||||||
cp -r ./open-resume.com.d/fonts $outdir/public/
|
cp -r ./open-resume.com.d/fonts $outdir/public/
|
||||||
|
|
||||||
|
(
|
||||||
|
if ! which woff2_compress; then
|
||||||
|
sudo apt -y install woff2
|
||||||
|
fi
|
||||||
|
set -ueo pipefail
|
||||||
|
for f in "$outdir"/public/fonts/*.ttf; do
|
||||||
|
echo ttf to woff2 for "$f"
|
||||||
|
if [ -f "$f" ]; then
|
||||||
|
woff2_compress "$f"
|
||||||
|
rm "$f"
|
||||||
|
fi
|
||||||
|
basename_f="${f##*/}"
|
||||||
|
find "$outdir/public" -type f | grep -v public.fonts | while read -r f2; do
|
||||||
|
sed -i "s#$basename_f#${basename_f%.ttf}.woff2#g" "$f2"
|
||||||
|
done
|
||||||
|
echo asserting no $basename_f
|
||||||
|
! grep -R "$basename_f" "$outdir/public"
|
||||||
|
echo asserting ${basename_f%.ttf}.woff2
|
||||||
|
grep -R "${basename_f%.ttf}.woff2" "$outdir/public"
|
||||||
|
done
|
||||||
|
du -sh "$outdir/public/fonts/"*
|
||||||
|
)
|
||||||
|
|
||||||
cp -r ./firebase.json ./.firebaserc ./.firebase $outdir/
|
cp -r ./firebase.json ./.firebaserc ./.firebase $outdir/
|
||||||
sed -i "s#deploy/public#public#" $outdir/firebase.json
|
sed -i "s#deploy/public#public#" $outdir/firebase.json
|
||||||
cd $outdir
|
cd $outdir
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue