File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load diff This file was deleted.
Original file line number Diff line number Diff line change 2222
2323 optimize :
2424 needs : convert
25- uses : ./.github/workflows/optimize.yml
25+ runs-on : ubuntu-latest
26+ steps :
27+ - name : Download converted artifact
28+ uses : actions/download-artifact@v8
29+ with :
30+ name : converted
31+ path : pages
32+
33+ - name : Install tools
34+ run : |
35+ sudo apt-get install -y webp minify parallel
36+
37+ - name : Optimize still images
38+ run : >
39+ find pages/ \( -iname "*.png" -o -iname "*.jpg" -o -iname "*.jpeg" \) -print0
40+ | parallel -0 'cwebp -lossless -q 100 {} -o {.}.webp && rm {}'
41+
42+ - name : Optimize gif images
43+ run : >
44+ find pages/ -iname "*.gif" -print0
45+ | parallel -0 'gif2webp -min_size -q 100 {} -o {.}.webp && rm {} || echo "::warning::Skipped optimizing {}"'
46+
47+ - name : Optimize text
48+ run : |
49+ find pages/ -name "*.html" | parallel minify --html-keep-document-tags --html-keep-end-tags --html-keep-whitespace -o {} {}
50+ find pages/ -name "*.css" | parallel minify -o {} {}
51+ find pages/ -name "*.js" | parallel minify -o {} {}
52+
53+ - name : Upload optimized artifact
54+ uses : actions/upload-artifact@v7
55+ with :
56+ name : optimized
57+ path : pages
58+ retention-days : 1
2659
2760 deploy :
2861 needs : optimize
Original file line number Diff line number Diff line change 66 <Folder Name =" /Solution Items/Workflows/" >
77 <File Path =" ../.github/workflows/converter.yml" />
88 <File Path =" ../.github/workflows/deploy.yml" />
9- <File Path =" ../.github/workflows/optimize.yml" />
109 <File Path =" ../.github/workflows/publish_book.yml" />
1110 <File Path =" ../.github/workflows/publish_index.yml" />
1211 </Folder >
You can’t perform that action at this time.
0 commit comments