Install netlify:
npm install -g netlify-cli
Set it up like so, this will open a few web pages and create a netlify account with github login, authorize netlify, setup the github hook for deploy, etc.:
repositories/ringbuf.js::master$ netlify init
Logging into your Netlify account...
Opening https://app.netlify.com/authorize?response_type=ticket&ticket=e527b77c4d5c2a95a57c063ccb193459
You are now logged into your Netlify account!
Run netlify status for account details
To see all available commands run: netlify help
? What would you like to do? + Create & configure a new site
? Team: Paul Adenot's team
Choose a unique site name (e.g. super-cool-site-by-padenot.netlify.app) or leave it blank for a random name. You can update the site name later.
? Site name (optional): ringbuf-js
Site Created
Admin URL: https://app.netlify.com/sites/ringbuf-js
URL: https://ringbuf-js.netlify.app
Site ID: xxx
? Netlify CLI needs access to your GitHub account to configure Webhooks and Deploy Keys. What would you like to do? Authorize with GitHub through app.netlify.com
? Your build command (hugo build/yarn run build/etc): npm run-script build
? Directory to deploy (blank for current dir): example
Creating Netlify Github Notification Hooks...
Netlify Notification Hooks configured!
Success! Netlify CI/CD Configured!
This site is now configured to automatically deploy from github branches & pull requests
Next steps:
git push Push to your git repository to trigger new site builds
netlify open Open the Netlify admin URL of your site
And then configure netlify to serve the headers:
cd examples
echo "/*" > _headers
echo " Cross-Origin-Opener-Policy: same-origin" >> _headers
echo " Cross-Origin-Embedder-Policy: require-corp" >> _headers
cd -
git add . .* #also adds the .netlify directory
git commit -m"add netlify config"
git push
Voilà.