Skip to content

Netlify

00:00 / 00:00

Deploying to Netlify

Netlify is a hosting and automation platform that allows developers to deploy static web applications easily and quickly.

Additionally, Netlify offers a free plan that includes:

  • Static website hosting.
  • SSL certificate.
  • Continuous integration.
  • Branch and pull request deployments.

In this example, we’ll see how to deploy the “Get Started Astro” project by Content Island on Netlify.

Step 1: Create a Repository

The first thing we need to deploy this project is a GitHub repository:

  • Log into your GitHub account and create a new repository.
  • Give it a name, e.g., get-started-deploy-netlify.
  • You can choose to make it public or private—either is fine, since we’ll later give Netlify access to it.
  • Click the create button without adding any files.

Copy the URL of the newly created repository and clone it to your local machine in an empty folder using the following command:

git clone <repository URL> .

Note the period at the end—it tells Git not to create an extra folder with the repository name.

Now, with the Astro project cloned, simply copy the contents of the blog-site folder into this new folder and push it to the repository using these commands:

git add .
git commit -m "Initial commit"
git push

You should now see the project uploaded to your GitHub repository.

Step 2: Configure Deployment

To configure deployment on Netlify, you need to have an account on the platform.

Once logged in, on the homepage, click the Add new site button and select Import an existing project.

Add new Netlify project

Select GitHub as the deployment source since that’s where our project is hosted.

Deploy with GitHub

If this is your first time, you’ll need to grant Netlify access to your GitHub account.

Configure Netlify with GitHub

You can choose to allow access to all repositories or only specific ones. In this case, select the repository you just created.

Once configured, you’ll be able to select the repository to deploy, and the configuration options will appear.

Choose the name that Netlify will use as your app's subdomain:

Add app name

If necessary, you can change the build settings, but in this case, the default settings will work fine.

Build settings

Now let’s add a new environment variable. Remember, when the project is built, it connects to your Content Island project to retrieve the data for each Post.

Add new environment variable

So, we need to configure the CONTENT_ISLAND_SECRET_TOKEN environment variable, using the value provided by Content Island in the General tab.

Add Content Island Token

Then click Deploy.

And that’s it! Your project with Content Island and Astro is now successfully deployed on Netlify.