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
33 changes: 32 additions & 1 deletion .github/workflows/deploy-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,20 @@ 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: Gatsby main cache
uses: actions/cache@v4
id: gatsby-cache-folder
Expand All @@ -91,7 +105,24 @@ jobs:

- run: npm install

- run: npm run build
- name: Patch Gatsby Config
run: |
node -e "
const fs = require('fs');
const configFile = 'gatsby-config.js';
let content = fs.readFileSync(configFile, 'utf-8');
const oldString = 'path: \`\${__dirname}/content\`,';
const newString = 'path: \`\${__dirname}/content\`,\\n ignore: [\`**/*.zip\`, \`**/*.mp4\`, \`**/*.pdf\`, \`**/*.gif\`],';
content = content.replace(oldString, newString);
fs.writeFileSync(configFile, content);
console.log('Patched gatsby-config.js');
"

- 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
33 changes: 32 additions & 1 deletion .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,20 @@ 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: Gatsby main cache
uses: actions/cache@v4
id: gatsby-cache-folder
Expand All @@ -91,7 +105,24 @@ jobs:

- run: npm install

- run: npm run build
- name: Patch Gatsby Config
run: |
node -e "
const fs = require('fs');
const configFile = 'gatsby-config.js';
let content = fs.readFileSync(configFile, 'utf-8');
const oldString = 'path: \`\${__dirname}/content\`,';
const newString = 'path: \`\${__dirname}/content\`,\\n ignore: [\`**/*.zip\`, \`**/*.mp4\`, \`**/*.pdf\`, \`**/*.gif\`],';
content = content.replace(oldString, newString);
fs.writeFileSync(configFile, content);
console.log('Patched gatsby-config.js');
"

- 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
14 changes: 14 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,20 @@ 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: Gatsby main cache
uses: actions/cache@v4
id: gatsby-cache-folder
Expand Down
Loading