Deployment overview

deployment-flow-diagram

Build a branch

When you push commits to the master branch, a build is automatically triggered (if there's currently no build running). To build a branch other than master, you need to push a (probably empty) commit with the message #build to that branch to trigger Continuous Integration (CI) to build it.

After the build is successful, the CI will add a commit with the built assets and create a release tag in the form YYYY.MM.DD.HH.II.

Test the build

Successful master builds are automatically deployed to your staging environment, where you can test your changes before promoting the build to the production environment.

The master build for frontend gets deployed automatically to your staging site on Netlify. You can use the staging site to test changes before promoting them to the production environment.

Deploy the backend

You can deploy the backend using either of these two ways:

  1. Using the command-line
  2. Using the studio

Deploy using the command-line

To deploy your backend using the command-line, follow these steps:

  1. From the studio home page or from the left menu, go to Developer.
  2. Click Deployment.
  3. Click Deploy from command line expandable section to view its content.
  4. To copy the command, click the content inside the Deploy from command line section.
  5. Open terminal on your computer.
  6. Paste the copied command in the terminal.
  7. Replace ####.##.##.##.## with the build version you want to deploy and env with the deployment environment (staging or production).
  8. Press enter to run the command.

Deploy using the studio

To create a new backend deployment, follow these steps:

  1. From the studio home page or from the left menu, go to Developer.
  2. Click Deployment.
  3. In the Backend deployments expandable section, click Deploy new version on the deployment environment you want: the Builds available dialog opens.
  4. Click the build version you want to deploy.

Deploy the frontend

The auto-publishing feature is turned off on your production site. Hence, you'll have to manually deploy a build to production. To deploy a build to production, follow the manual deploys guideExternal link icon on Netlify.

View backend deployments

To view backend deployment status, follow these steps:

  1. From the studio home page or from the left menu, go to Developer.
  2. Click Deployment.
  3. In the Backend deployments expandable section, you'll see the current deployment's Frontend API URL, version, and status.

View backend deployment logs

To view backend deployment logs, follow these steps:

  1. From the studio home page or from the left menu, go to Developer.
  2. Click Deployment.
  3. In the Backend deployments expandable section, click View deployment log on the deployment environment you want: the Deployment logs for version dialog opens where you can view the logs from the current build version.

View frontend deployments

To view the frontend deployments, , follow these steps:

  1. From the studio home page or from the left menu, go to Developer.
  2. Click Deployment.
  3. Click Go to Netlify in the Frontend development expandable section.
Information icon

The Go to Netlify link will stop working if you change your Netlify team's name from frontastic-<your-team> to anything else.

To learn about viewing frontend deployment logs or status, see deploy logsExternal link icon or monitor buildsExternal link icon on Netlify.

Roll back backend deployments

To roll back a backend deployment, follow these steps:

  1. From the studio home page or from the left menu, go to Developer.
  2. Click Deployment.
  3. To roll back to the previous build, click Rollback to <version number> on the environment you want. Otherwise, to roll back to an older build:
    1. Click Deploy new version on the deployment environment you want: the Builds available dialog opens.
    2. Click the build version you want to roll back to.

Roll back frontend deployments

To roll back the frontend application to an older build, see RollbacksExternal link icon on Netlify.

Deploy a hot-fix for backend

A hot-fix lets you to deploy a bug fix using the code from current deployment. For example, you're currently testing a big new feature that isn't ready to go live yet, but you need to deploy an urgent fix to production.

To deploy a hot-fix for your backend, follow these steps:

  1. From the studio home page or from the left menu, go to Developer.

  2. Click Deployment.

  3. In the Backend deployments expandable section, you'll see the current deployment's version. Each build version corresponds to a release commit and tag in your GitHub repository.

  4. To create a branch for your fix from the backend production version, run the following command in your project's root:

    git checkout -b fix/something-urgent <current-deployment-version>
    Clipboard icon
  5. Apply your fix, and push the branch to the remote repository by running the following command:

    git push -u origin fix/something-urgent
    Clipboard icon
  6. To start the build on the CI server, create an empty commit with a message containing the #build keyword by running the following command:

    git commit -m 'ci: #build' --allow-empty
    Clipboard icon
  7. Push the ci: #build commit, by running the following command:

    git push
    Clipboard icon
  8. After the build is successful, deploy the build to the production environment.

  9. To avoid losing the fix, make sure you merge the fix/something-urgent branch into the master branch.

Deploy a hot-fix for frontend

To deploy a hot-fix for frontend application, see manual deploysExternal link icon on Netlify.