Skip to content

Commit ed02e72

Browse files
committed
increase max space size
1 parent 3ebd1b4 commit ed02e72

File tree

5 files changed

+126
-12
lines changed

5 files changed

+126
-12
lines changed

.github/workflows/deploy-production.yml

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,46 @@ 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: Fail on Oversized Files
89+
# id: fail_on_oversized_files
90+
# run: |
91+
# #!/bin/bash
92+
# # This script is a stricter check that fails the workflow if files exceed size limits.
93+
# set -e
94+
95+
# # Thresholds in Megabytes (same as the warning step)
96+
# IMAGE_LIMIT_MB=2
97+
# ASSET_LIMIT_MB=10
98+
99+
# # Find oversized files and prepare a detailed report
100+
# OVERSIZED_FILES=$(find content -type f \
101+
# \( \( -name "*.png" -o -name "*.jpg" -o -name "*.jpeg" -o -name "*.svg" -o -name "*.gif" \) -size "+${IMAGE_LIMIT_MB}M" \) -o \
102+
# \( \( -name "*.pdf" -o -name "*.zip" -o -name "*.mp4" \) -size "+${ASSET_LIMIT_MB}M" \) \
103+
# -exec ls -lh {} + | awk '{printf " - %s (%s)\n", $9, $5}')
104+
105+
# # Check if the report is non-empty and fail the job if so
106+
# if [ -n "$OVERSIZED_FILES" ]; then
107+
# echo "::error::Found files exceeding size limits. This new check is failing the build as intended."
108+
# echo "--------------------------------------------------"
109+
# echo "Oversized Files Found:"
110+
# echo "$OVERSIZED_FILES"
111+
# echo "--------------------------------------------------"
112+
# echo "Limits:"
113+
# echo " - Images (PNG, JPG, SVG, GIF): ${IMAGE_LIMIT_MB}MB"
114+
# echo " - Assets (PDF, ZIP, MP4): ${ASSET_LIMIT_MB}MB"
115+
# exit 1
116+
# else
117+
# echo "No oversized files found. New check passed."
118+
# fi
119+
120+
- name: Compress Large Images
121+
run: |
122+
sudo apt-get update && sudo apt-get install -y jpegoptim optipng
123+
echo "Compressing large JPGs..."
124+
find content -type f \( -name "*.jpg" -o -name "*.jpeg" \) -size +2M -print -exec jpegoptim --strip-all {} \;
125+
echo "Compressing large PNGs..."
126+
find content -type f -name "*.png" -size +2M -print -exec optipng -o2 {} \;
127+
88128
- name: Gatsby main cache
89129
uses: actions/cache@v4
90130
id: gatsby-cache-folder
@@ -105,9 +145,6 @@ jobs:
105145
106146
- run: npm install
107147

108-
- name: Verify Gatsby Config
109-
run: cat gatsby-config.js
110-
111148
- name: Build
112149
run: npm run build
113150

.github/workflows/deploy-staging.yml

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,46 @@ 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: Fail on Oversized Files
89+
# id: fail_on_oversized_files
90+
# run: |
91+
# #!/bin/bash
92+
# # This script is a stricter check that fails the workflow if files exceed size limits.
93+
# set -e
94+
95+
# # Thresholds in Megabytes (same as the warning step)
96+
# IMAGE_LIMIT_MB=2
97+
# ASSET_LIMIT_MB=10
98+
99+
# # Find oversized files and prepare a detailed report
100+
# OVERSIZED_FILES=$(find content -type f \
101+
# \( \( -name "*.png" -o -name "*.jpg" -o -name "*.jpeg" -o -name "*.svg" -o -name "*.gif" \) -size "+${IMAGE_LIMIT_MB}M" \) -o \
102+
# \( \( -name "*.pdf" -o -name "*.zip" -o -name "*.mp4" \) -size "+${ASSET_LIMIT_MB}M" \) \
103+
# -exec ls -lh {} + | awk '{printf " - %s (%s)\n", $9, $5}')
104+
105+
# # Check if the report is non-empty and fail the job if so
106+
# if [ -n "$OVERSIZED_FILES" ]; then
107+
# echo "::error::Found files exceeding size limits. This new check is failing the build as intended."
108+
# echo "--------------------------------------------------"
109+
# echo "Oversized Files Found:"
110+
# echo "$OVERSIZED_FILES"
111+
# echo "--------------------------------------------------"
112+
# echo "Limits:"
113+
# echo " - Images (PNG, JPG, SVG, GIF): ${IMAGE_LIMIT_MB}MB"
114+
# echo " - Assets (PDF, ZIP, MP4): ${ASSET_LIMIT_MB}MB"
115+
# exit 1
116+
# else
117+
# echo "No oversized files found. New check passed."
118+
# fi
119+
120+
- name: Compress Large Images
121+
run: |
122+
sudo apt-get update && sudo apt-get install -y jpegoptim optipng
123+
echo "Compressing large JPGs..."
124+
find content -type f \( -name "*.jpg" -o -name "*.jpeg" \) -size +2M -print -exec jpegoptim --strip-all {} \;
125+
echo "Compressing large PNGs..."
126+
find content -type f -name "*.png" -size +2M -print -exec optipng -o2 {} \;
127+
88128
- name: Gatsby main cache
89129
uses: actions/cache@v4
90130
id: gatsby-cache-folder
@@ -105,9 +145,6 @@ jobs:
105145
106146
- run: npm install
107147

108-
- name: Verify Gatsby Config
109-
run: cat gatsby-config.js
110-
111148
- name: Build
112149
run: npm run build
113150

.github/workflows/preview.yml

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
fetch-depth: 1
6868

6969
- name: Cleanup runner disk
70-
uses: ./.github/actions/cleanup-disk
70+
uses: ./.github/actions/cleanup-disk
7171
- uses: actions/setup-node@v4
7272
with:
7373
node-version: 18
@@ -103,6 +103,46 @@ 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: Fail on Oversized Files
107+
# id: fail_on_oversized_files
108+
# run: |
109+
# #!/bin/bash
110+
# # This script is a stricter check that fails the workflow if files exceed size limits.
111+
# set -e
112+
113+
# # Thresholds in Megabytes (same as the warning step)
114+
# IMAGE_LIMIT_MB=2
115+
# ASSET_LIMIT_MB=10
116+
117+
# # Find oversized files and prepare a detailed report
118+
# OVERSIZED_FILES=$(find content -type f \
119+
# \( \( -name "*.png" -o -name "*.jpg" -o -name "*.jpeg" -o -name "*.svg" -o -name "*.gif" \) -size "+${IMAGE_LIMIT_MB}M" \) -o \
120+
# \( \( -name "*.pdf" -o -name "*.zip" -o -name "*.mp4" \) -size "+${ASSET_LIMIT_MB}M" \) \
121+
# -exec ls -lh {} + | awk '{printf " - %s (%s)\n", $9, $5}')
122+
123+
# # Check if the report is non-empty and fail the job if so
124+
# if [ -n "$OVERSIZED_FILES" ]; then
125+
# echo "::error::Found files exceeding size limits. This new check is failing the build as intended."
126+
# echo "--------------------------------------------------"
127+
# echo "Oversized Files Found:"
128+
# echo "$OVERSIZED_FILES"
129+
# echo "--------------------------------------------------"
130+
# echo "Limits:"
131+
# echo " - Images (PNG, JPG, SVG, GIF): ${IMAGE_LIMIT_MB}MB"
132+
# echo " - Assets (PDF, ZIP, MP4): ${ASSET_LIMIT_MB}MB"
133+
# exit 1
134+
# else
135+
# echo "No oversized files found. New check passed."
136+
# fi
137+
138+
- name: Compress Large Images
139+
run: |
140+
sudo apt-get update && sudo apt-get install -y jpegoptim optipng
141+
echo "Compressing large JPGs..."
142+
find content -type f \( -name "*.jpg" -o -name "*.jpeg" \) -size +2M -print -exec jpegoptim --strip-all {} \;
143+
echo "Compressing large PNGs..."
144+
find content -type f -name "*.png" -size +2M -print -exec optipng -o2 {} \;
145+
106146
- name: Gatsby main cache
107147
uses: actions/cache@v4
108148
id: gatsby-cache-folder

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
},
1919
"homepage": "https://github.com/arduino/docs-content#readme",
2020
"dependencies": {
21-
"@arduino/docs-arduino-cc": "^2.1.7",
21+
"@arduino/docs-arduino-cc": "^2.1.8-alpha.2",
2222
"gatsby": "^5.11.0",
2323
"gatsby-background-image": "^1.6.0",
2424
"gatsby-image": "^3.11.0",

0 commit comments

Comments
 (0)