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 NetlifyStep(env, prod) = {
local NetlifyStep(env) =
local prod = env == 'production';
{
name: 'netlify deploy ' + env,
image: 'internetmat/drone-netlify',
volumes: [Volume],
@ -11,11 +13,11 @@ local NetlifyStep(env, prod) = {
},
when: if prod then {
event: ['promote'],
target: ['prod'],
target: ['production'],
} else {
target: { exclude: ['prod'] },
target: { exclude: ['production'] },
},
};
};
{
kind: 'pipeline',
type: 'docker',
@ -37,7 +39,7 @@ local NetlifyStep(env, prod) = {
'cp -r result/* /site/',
],
},
NetlifyStep('staging', false),
NetlifyStep('prod', true),
NetlifyStep('staging'),
NetlifyStep('production'),
],
}

View File

@ -46,4 +46,15 @@
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 = ""