Skip to content

Commit a5a0506

Browse files
committed
Update config
1 parent 54c2983 commit a5a0506

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

.github/workflows/deploy-production.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,16 @@ jobs:
107107

108108
- name: Patch Gatsby Config
109109
run: |
110-
sed -i.bak "/path: \`${__dirname}\/content\`,\s*$/a \ \ \ \ \ \ \ \ ignore: [\`**/*.zip\`, \`**/*.mp4\`, \`**/*.pdf\`, \`**/*.gif\`]," gatsby-config.js
110+
node -e "
111+
const fs = require('fs');
112+
const configFile = 'gatsby-config.js';
113+
let content = fs.readFileSync(configFile, 'utf-8');
114+
const oldString = 'path: \`\${__dirname}/content\`,';
115+
const newString = 'path: \`\${__dirname}/content\`,\\n ignore: [\`**/*.zip\`, \`**/*.mp4\`, \`**/*.pdf\`, \`**/*.gif\`],';
116+
content = content.replace(oldString, newString);
117+
fs.writeFileSync(configFile, content);
118+
console.log('Patched gatsby-config.js');
119+
"
111120
112121
- name: Verify Gatsby Config
113122
run: cat gatsby-config.js

.github/workflows/deploy-staging.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,16 @@ jobs:
107107

108108
- name: Patch Gatsby Config
109109
run: |
110-
sed -i.bak "/path: \`${__dirname}\/content\`,\s*$/a \ \ \ \ \ \ \ \ ignore: [\`**/*.zip\`, \`**/*.mp4\`, \`**/*.pdf\`, \`**/*.gif\`]," gatsby-config.js
110+
node -e "
111+
const fs = require('fs');
112+
const configFile = 'gatsby-config.js';
113+
let content = fs.readFileSync(configFile, 'utf-8');
114+
const oldString = 'path: \`\${__dirname}/content\`,';
115+
const newString = 'path: \`\${__dirname}/content\`,\\n ignore: [\`**/*.zip\`, \`**/*.mp4\`, \`**/*.pdf\`, \`**/*.gif\`],';
116+
content = content.replace(oldString, newString);
117+
fs.writeFileSync(configFile, content);
118+
console.log('Patched gatsby-config.js');
119+
"
111120
112121
- name: Verify Gatsby Config
113122
run: cat gatsby-config.js

0 commit comments

Comments
 (0)