Back to topic list

Deploying with Netlify

The awesome Netlify service is ideal for enduro.js workflow. It is ready to host your enduro.js static website for an unbeatable price (or even for free, check out their pricing) and the deployment process could not be easier.

Getting ready

You only need two things for this to work:

  • Enduro.js project (pssst, you can just enduro theme mirror)
  • Netlify cli tools (npm install netlify-cli -g)

Deploying your website

Manual deploy

This is shockingly easy: Just do enduro render && netlify deploy -p _generated and your website is live.

To break this down:

  • enduro render will generate all the static files and stage everything into a _generated subfolder.
  • netlify deploy will create a new Netlify app
  • -p _generated will specify that you will be wanting to upload the _generated folder.

Doing this properly with Github

Netlify can be linked to a Github repository. This way, Netlify will rebuild the static website each time you update your git repository. This is the proper way to do this.

All you need to do is initiate netlify init command. Notice, that you have to have an origin set up with ssh.

When the cli process prompts you, just input these values.

Prompt Value
Directory to deploy _generated
Build command enduro build

Then it just takes about a minute for Netlify to build your website.

No cli approach

Just for the sake of providing all options, you can also just drag the _generated folder into Netlify web user interface and it will work awesomely. Whatever. It is dead simple and it works.

Limitations

Netlify offers purely static hosting. If your project has some api functionality or you've set up some pages to be dynamic you'll have to use node.js hosting such as heroku. With Netlify you won't be able to use admin interface to change your website. You'll have to use localhost:5000/admin or just change the files manually.

Back to topic list

Shout out to pexels and freepik