-
Notifications
You must be signed in to change notification settings - Fork 31
/
netlify.toml
94 lines (79 loc) · 3.06 KB
/
netlify.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# Common build configuration inherited by
# all other configurations
[build]
command = "npm run test && npm run generate"
publish = "dist"
# Environment variable used by production branch i.e master
[context.production]
command = "cd functions/take-screenshot && npm i && cd ../../ && NODE_ENV=production npm run generate"
functions = "functions/"
[context.production.environment]
API_BASE_URL = "https://api.coronatracker.com"
BASE_URL = "https://www.coronatracker.com"
GENERATE_ROUTES = "true"
# Environment variable overriden for staging branch
[context.staging]
command = "cd functions/take-screenshot && npm i && cd ../../ && NODE_ENV=production npm run generate"
functions = "functions/"
[context.staging.environment]
API_BASE_URL = "https://api.coronatracker.com"
BASE_URL = "https://staging.coronatracker.com"
GA_ID = "UA-xxxxxxxxx-x"
GENERATE_ROUTES = "true"
# Environment variable overriden for dev branch
[context.dev]
command = "cd functions/take-screenshot && npm i && cd ../../ && npm run test && npm run generate"
functions = "functions/"
[context.dev.environment]
API_BASE_URL = "https://api.staging.coronatracker.com"
BASE_URL = "https://staging.coronatracker.com"
GA_ID = "UA-xxxxxxxxx-x"
GENERATE_ROUTES = "false"
# Environment variable overriden for "feature/netlify-function" branch
[context."feature/netlify-function"]
command = "cd functions/take-screenshot && npm i && cd ../../ && npm run test && npm run generate"
functions = "functions/"
[context."feature/netlify-function".environment]
API_BASE_URL = "https://api.staging.coronatracker.com"
BASE_URL = "https://staging.coronatracker.com"
GA_ID = "UA-xxxxxxxxx-x"
GENERATE_ROUTES = "false"
# Environment variable overriden for deploy-preview's
# Deploy preview's are generated by pull/merge requests
[context.deploy-preview]
command = "cd functions/take-screenshot && npm i && cd ../../ && NODE_ENV=production npm run generate"
functions = "functions/"
[context.deploy-preview.environment]
API_BASE_URL = "https://api.staging.coronatracker.com"
BASE_URL = "https://staging.coronatracker.com"
GA_ID = "UA-xxxxxxxxx-x"
GENERATE_ROUTES = "false"
# Environment variable overriden for branch deploys
# Branch deployes are applicable for non-master branches
# Such as staging, dev branches
[context.branch-deploy]
command = "cd functions/take-screenshot && npm i && cd ../../ && NODE_ENV=production npm run generate"
functions = "functions/"
[context.branch-deploy.environment]
API_BASE_URL = "https://api.staging.coronatracker.com"
BASE_URL = "https://staging.coronatracker.com"
GA_ID = "UA-xxxxxxxxx-x"
GENERATE_ROUTES = "false"
[[redirects]]
from = "/blog"
to = "https://blog.coronatracker.com/blog/"
status = 200
force = true
headers = {X-From = "Netlify"}
[[redirects]]
from = "/blog/*/"
to = "https://blog.coronatracker.com/blog/:splat"
status = 200
force = true
headers = {X-From = "Netlify"}
[[redirects]]
from = "/blog/*"
to = "https://blog.coronatracker.com/blog/:splat/"
status = 200
force = true
headers = {X-From = "Netlify"}