Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion .github/workflows/deploy-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,28 @@ jobs:
find ./content/hardware -type f -name "*-pinout.png" -exec cp {} ./static/resources/pinouts/ \;
find ./content/hardware -type f -name "*-step.zip" -exec cp {} ./static/resources/models/ \;

- name: Check for large files
run: |
find content -type f \( -name "*.png" -o -name "*.jpg" -o -name "*.jpeg" -o -name "*.svg" -o -name "*.gif" \) -size +2M -print0 |
while IFS= read -r -d $'\0' file; do
size=$(ls -lh "$file" | awk '{print $5}')
echo "::warning file=$file::File '$file' is very large: $size. Consider optimizing it."
done

find content -type f \( -name "*.pdf" -o -name "*.zip" -o -name "*.mp4" \) -size +10M -print0 |
while IFS= read -r -d $'\0' file; do
size=$(ls -lh "$file" | awk '{print $5}')
echo "::warning file=$file::File '$file' is very large: $size. This can impact repository size and checkout times."
done

- name: Compress Large Images
run: |
sudo apt-get update && sudo apt-get install -y jpegoptim optipng
echo "Compressing large JPGs..."
find content -type f \( -name "*.jpg" -o -name "*.jpeg" \) -size +2M -print -exec jpegoptim --strip-all {} \;
echo "Compressing large PNGs..."
find content -type f -name "*.png" -size +2M -print -exec optipng -o2 {} \;

- name: Gatsby main cache
uses: actions/cache@v4
id: gatsby-cache-folder
Expand All @@ -91,7 +113,11 @@ jobs:

- run: npm install

- run: npm run build
- name: Verify Gatsby Config
run: cat gatsby-config.js

- name: Build
run: npm run build

- name: Clean up node_modules # Just to save space
run: rm -rf node_modules
Expand Down
28 changes: 27 additions & 1 deletion .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,28 @@ jobs:
find ./content/hardware -type f -name "*-pinout.png" -exec cp {} ./static/resources/pinouts/ \;
find ./content/hardware -type f -name "*-step.zip" -exec cp {} ./static/resources/models/ \;

- name: Check for large files
run: |
find content -type f \( -name "*.png" -o -name "*.jpg" -o -name "*.jpeg" -o -name "*.svg" -o -name "*.gif" \) -size +2M -print0 |
while IFS= read -r -d $'\0' file; do
size=$(ls -lh "$file" | awk '{print $5}')
echo "::warning file=$file::File '$file' is very large: $size. Consider optimizing it."
done

find content -type f \( -name "*.pdf" -o -name "*.zip" -o -name "*.mp4" \) -size +10M -print0 |
while IFS= read -r -d $'\0' file; do
size=$(ls -lh "$file" | awk '{print $5}')
echo "::warning file=$file::File '$file' is very large: $size. This can impact repository size and checkout times."
done

- name: Compress Large Images
run: |
sudo apt-get update && sudo apt-get install -y jpegoptim optipng
echo "Compressing large JPGs..."
find content -type f \( -name "*.jpg" -o -name "*.jpeg" \) -size +2M -print -exec jpegoptim --strip-all {} \;
echo "Compressing large PNGs..."
find content -type f -name "*.png" -size +2M -print -exec optipng -o2 {} \;

- name: Gatsby main cache
uses: actions/cache@v4
id: gatsby-cache-folder
Expand All @@ -91,7 +113,11 @@ jobs:

- run: npm install

- run: npm run build
- name: Verify Gatsby Config
run: cat gatsby-config.js

- name: Build
run: npm run build

- name: Clean up node_modules # Just to save space
run: rm -rf node_modules
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,28 @@ jobs:
find ./content/hardware -type f -name "*-pinout.png" -exec cp {} ./static/resources/pinouts/ \;
find ./content/hardware -type f -name "*-step.zip" -exec cp {} ./static/resources/models/ \;

- name: Check for large files
run: |
find content -type f \( -name "*.png" -o -name "*.jpg" -o -name "*.jpeg" -o -name "*.svg" -o -name "*.gif" \) -size +2M -print0 |
while IFS= read -r -d $'\0' file; do
size=$(ls -lh "$file" | awk '{print $5}')
echo "::warning file=$file::File '$file' is very large: $size. Consider optimizing it."
done

find content -type f \( -name "*.pdf" -o -name "*.zip" -o -name "*.mp4" \) -size +10M -print0 |
while IFS= read -r -d $'\0' file; do
size=$(ls -lh "$file" | awk '{print $5}')
echo "::warning file=$file::File '$file' is very large: $size. This can impact repository size and checkout times."
done

- name: Compress Large Images
run: |
sudo apt-get update && sudo apt-get install -y jpegoptim optipng
echo "Compressing large JPGs..."
find content -type f \( -name "*.jpg" -o -name "*.jpeg" \) -size +2M -print -exec jpegoptim --strip-all {} \;
echo "Compressing large PNGs..."
find content -type f -name "*.png" -size +2M -print -exec optipng -o2 {} \;

- name: Gatsby main cache
uses: actions/cache@v4
id: gatsby-cache-folder
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"homepage": "https://github.com/arduino/docs-content#readme",
"dependencies": {
"@arduino/docs-arduino-cc": "^2.1.7",
"@arduino/docs-arduino-cc": "^2.1.8-alpha.1",
"gatsby": "^5.11.0",
"gatsby-background-image": "^1.6.0",
"gatsby-image": "^3.11.0",
Expand Down
Loading