Try to apply special headers to deploy preview
continuous-integration/drone/push Build is passing Details

pull/1/head
mat ess 2022-10-20 19:07:18 -04:00
parent efc8b7df02
commit 7bd37145f1
2 changed files with 32 additions and 19 deletions

View File

@ -1,5 +1,7 @@
local Volume = { name: 'site', path: '/site' }; local Volume = { name: 'site', path: '/site' };
local NetlifyStep(env, prod) = { local NetlifyStep(env) =
local prod = env == 'production';
{
name: 'netlify deploy ' + env, name: 'netlify deploy ' + env,
image: 'internetmat/drone-netlify', image: 'internetmat/drone-netlify',
volumes: [Volume], volumes: [Volume],
@ -11,9 +13,9 @@ local NetlifyStep(env, prod) = {
}, },
when: if prod then { when: if prod then {
event: ['promote'], event: ['promote'],
target: ['prod'], target: ['production'],
} else { } else {
target: { exclude: ['prod'] }, target: { exclude: ['production'] },
}, },
}; };
{ {
@ -37,7 +39,7 @@ local NetlifyStep(env, prod) = {
'cp -r result/* /site/', 'cp -r result/* /site/',
], ],
}, },
NetlifyStep('staging', false), NetlifyStep('staging'),
NetlifyStep('prod', true), NetlifyStep('production'),
], ],
} }

View File

@ -46,4 +46,15 @@
allow-popups-to-escape-sandbox allow-popups-to-escape-sandbox
''' '''
[context.deploy-preview]
[[headers]]
for = "/*"
[headers.values]
Permissions-Policy = "interest-cohort=()"
Strict-Transport-Security = "max-age=63072000; includeSubDomains; preload"
X-Content-Type-Options = "nosniff"
X-Frame-Options = "DENY"
Referrer-Policy = "no-referrer"
Content-Security-Policy = ""