Deploy to Netlify
How to deploy to Netlify?
To start deploying to Netlify, you need to create a site in Netlify and set up a continuous deployment pipeline in Buddy. Netlify allows you to run static websites created with Next.js Astro Build, Gatsby, Nuxt, Solid, Hugo, Angular. You can build all of them using Buddy and deploy them to Netlify.
Image loading...
Configure pipeline in Buddy
- Create a new project in Buddy and select your Git provider.
Image loading...
- Add a new pipeline and configure the details: name, trigger mode, and a branch from which you want to deploy.
Image loading...
Before you add the Netlify action to your pipeline, you need to create a site on Netlify.
How to create a site on Netlify?
To create a new site on Netlify:
- Go to Sites tab in your Netlify account and click Import from:
Image loading...
- Select your Git repository provider, authorize access and select the project that you want to develop:
Image loading...
- Select the team and provide the site name to finish the configuration.
- Since your static site is built in Buddy, you need to disable builds on Netlify to avoid duplication and prevent potential conflicts. To do it, go to the previously created site, open the Deploys tab and click Deploy Settings:
Image loading...
- Navigate to the Build settings and click Configure. Change the setting for Build status to 'Stopped builds':
Image loading...
From now on, your site will be built by Buddy. You can now go back to your pipeline and start the configuration.
Configure Netlify deployment
- Look up and click Netlify on the action list to add it to the pipeline:
Image loading...
- The action launches a container with the Netlify CLI preinstalled. It has five configuration tabs:
- Run – here you select the Netlify integration and provide the deployment command
- Environment – if your process requires specific dependencies, you can install them here. The files will stay cached in the container for future pipeline runs
- Variables – here you can add and modify environment variables required by your workflow
- Conditions – here you configure the trigger conditions for which the action will run
- Options – here you define the action's name and behavior on failure and timeout
Image loading...
In the Commands section, the flag:
--dir=
- indicates which folder should be deployed (different static site generators may use different output folders).
--prodIfUnlocked
- instructs Netlify to deploy the website to the production environment only when the deployment key is unlocked, ensuring secure control over production deployments.
- When ready, click Add this action to finish configuration.
Last modified on Sep 24, 2024