Deployment overview
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:
Deploy using the command-line
To deploy your backend using the command-line, follow these steps:
- From the studio home page or from the left menu, go to Developer.
- Click Deployment.
- Click Deploy from command line expandable section to view its content.
- To copy the command, click the content inside the Deploy from command line section.
- Open terminal on your computer.
- Paste the copied command in the terminal.
- Replace
####.##.##.##.##
with the build version you want to deploy andenv
with the deployment environment (staging
orproduction
). - Press enter to run the command.
Deploy using the studio
To create a new backend deployment, follow these steps:
- From the studio home page or from the left menu, go to Developer.
- Click Deployment.
- In the Backend deployments expandable section, click Deploy new version on the deployment environment you want: the Builds available dialog opens.
- 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 guide on Netlify.
View backend deployments
To view backend deployment status, follow these steps:
- From the studio home page or from the left menu, go to Developer.
- Click Deployment.
- 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:
- From the studio home page or from the left menu, go to Developer.
- Click Deployment.
- 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:
- From the studio home page or from the left menu, go to Developer.
- Click Deployment.
- Click Go to Netlify in the Frontend development expandable section.
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 logs or monitor builds on Netlify.
Roll back backend deployments
To roll back a backend deployment, follow these steps:
- From the studio home page or from the left menu, go to Developer.
- Click Deployment.
- 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:
- Click Deploy new version on the deployment environment you want: the Builds available dialog opens.
- 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 Rollbacks 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:
From the studio home page or from the left menu, go to Developer.
Click Deployment.
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.
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>Apply your fix, and push the branch to the remote repository by running the following command:
git push -u origin fix/something-urgentTo 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-emptyPush the
ci: #build
commit, by running the following command:git pushAfter the build is successful, deploy the build to the production environment.
To avoid losing the fix, make sure you merge the
fix/something-urgent
branch into themaster
branch.
Deploy a hot-fix for frontend
To deploy a hot-fix for frontend application, see manual deploys on Netlify.