Skip to content

Commit fa5faf2

Browse files
committed
Only run youtinx in production.
1 parent 3bd0e95 commit fa5faf2

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

netlify.toml

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
11
[build]
2-
command = "npm run build:production"
2+
command = "npm run build"
33
publish = "dist"
44

55
[build.environment]
66
NODE_VERSION = "12.16.2"
77
NODE_ENV = "production"
88

9+
# This requires YOUTUBE_API_KEY and ALGOLIA_API_KEY
10+
[context.production]
11+
command = "npm run build:production"
12+
13+
# TODO remove this, this is just for testing
14+
[context.deploy-preview]
15+
command = "npm run build:production"
16+
17+
# TODO remove this, this is just for testing
18+
[context.branch-deploy]
19+
command = "npm run build:production"
20+
921
[dev]
1022
command = "npm run start"
1123
publish = "dist"

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"build": "npm-run-all build:html build:css",
1616
"build:html": "eleventy",
1717
"build:css": "postcss src/css/tailwind.css -o dist/css/styles.css",
18-
"data:jamstacktv": "youtinx pull",
18+
"data:jamstacktv": "youtinx pull && youtinx push",
1919
"watch:html": "ELEVENTY_ENV=dev eleventy --watch --quiet",
2020
"watch:css": "postcss src/css/tailwind.css -o dist/css/styles.css --watch",
2121
"serve": "live-server dist --quiet --port=8090",

src/site/_data/github.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ async function githubRequest(user, repo) {
3030
issues: "",
3131
};
3232

33-
if(process.env.ELEVENTY_ENV == 'dev') {
33+
if(process.env.ELEVENTY_ENV == 'dev' || !process.env.GITHUB_READ_TOKEN) {
3434
return errorData;
3535
}
3636

0 commit comments

Comments
 (0)