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,21 +1,23 @@
local Volume = { name: 'site', path: '/site' }; local Volume = { name: 'site', path: '/site' };
local NetlifyStep(env, prod) = { local NetlifyStep(env) =
name: 'netlify deploy ' + env, local prod = env == 'production';
image: 'internetmat/drone-netlify', {
volumes: [Volume], name: 'netlify deploy ' + env,
settings: { image: 'internetmat/drone-netlify',
token: { from_secret: 'netlify_token' }, volumes: [Volume],
site: { from_secret: 'netlify_site_id' }, settings: {
path: '/site', token: { from_secret: 'netlify_token' },
prod: prod, site: { from_secret: 'netlify_site_id' },
}, path: '/site',
when: if prod then { prod: prod,
event: ['promote'], },
target: ['prod'], when: if prod then {
} else { event: ['promote'],
target: { exclude: ['prod'] }, target: ['production'],
}, } else {
}; target: { exclude: ['production'] },
},
};
{ {
kind: 'pipeline', kind: 'pipeline',
type: 'docker', type: 'docker',
@ -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 = ""