Skip to content

Commit 5e7466c

Browse files
committed
increase img space
1 parent 2eb0377 commit 5e7466c

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

.github/workflows/deploy-production.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,14 @@ jobs:
8585
echo "::warning file=$file::File '$file' is very large: $size. This can impact repository size and checkout times."
8686
done
8787
88+
- name: Compress Large Images
89+
run: |
90+
sudo apt-get update && sudo apt-get install -y jpegoptim optipng
91+
echo "Compressing large JPGs..."
92+
find content -type f \( -name "*.jpg" -o -name "*.jpeg" \) -size +2M -print -exec jpegoptim --strip-all {} \;
93+
echo "Compressing large PNGs..."
94+
find content -type f -name "*.png" -size +2M -print -exec optipng -o2 {} \;
95+
8896
- name: Gatsby main cache
8997
uses: actions/cache@v4
9098
id: gatsby-cache-folder
@@ -111,6 +119,7 @@ jobs:
111119
- name: Build
112120
env:
113121
NODE_OPTIONS: --max-old-space-size=8192
122+
GATSBY_CPU_COUNT: 1
114123
run: npm run build
115124

116125
- name: Clean up node_modules # Just to save space

.github/workflows/deploy-staging.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,14 @@ jobs:
8585
echo "::warning file=$file::File '$file' is very large: $size. This can impact repository size and checkout times."
8686
done
8787
88+
- name: Compress Large Images
89+
run: |
90+
sudo apt-get update && sudo apt-get install -y jpegoptim optipng
91+
echo "Compressing large JPGs..."
92+
find content -type f \( -name "*.jpg" -o -name "*.jpeg" \) -size +2M -print -exec jpegoptim --strip-all {} \;
93+
echo "Compressing large PNGs..."
94+
find content -type f -name "*.png" -size +2M -print -exec optipng -o2 {} \;
95+
8896
- name: Gatsby main cache
8997
uses: actions/cache@v4
9098
id: gatsby-cache-folder
@@ -111,6 +119,7 @@ jobs:
111119
- name: Build
112120
env:
113121
NODE_OPTIONS: --max-old-space-size=8192
122+
GATSBY_CPU_COUNT: 1
114123
run: npm run build
115124

116125
- name: Clean up node_modules # Just to save space

.github/workflows/preview.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,14 @@ jobs:
103103
echo "::warning file=$file::File '$file' is very large: $size. This can impact repository size and checkout times."
104104
done
105105
106+
- name: Compress Large Images
107+
run: |
108+
sudo apt-get update && sudo apt-get install -y jpegoptim optipng
109+
echo "Compressing large JPGs..."
110+
find content -type f \( -name "*.jpg" -o -name "*.jpeg" \) -size +2M -print -exec jpegoptim --strip-all {} \;
111+
echo "Compressing large PNGs..."
112+
find content -type f -name "*.png" -size +2M -print -exec optipng -o2 {} \;
113+
106114
- name: Gatsby main cache
107115
uses: actions/cache@v4
108116
id: gatsby-cache-folder
@@ -122,7 +130,7 @@ jobs:
122130
${{ runner.os }}-public-gatsby-main
123131
124132
- run: npm install
125-
- run: GATSBY_HF_CDN_URL="" NODE_OPTIONS=--max-old-space-size=8192 npm run build
133+
- run: GATSBY_CPU_COUNT=1 GATSBY_HF_CDN_URL="" NODE_OPTIONS=--max-old-space-size=8192 npm run build
126134

127135
- name: Install Netlify
128136
run: npm install [email protected] -g

0 commit comments

Comments
 (0)