Skip to content

Commit 68dd870

Browse files
committed
No need nesting.
1 parent dd38d24 commit 68dd870

3 files changed

Lines changed: 34 additions & 43 deletions

File tree

.github/workflows/optimize.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

.github/workflows/publish_book.yml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,40 @@ jobs:
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

converter/converter.slnx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
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>

0 commit comments

Comments
 (0)