Deploying your site

Deploying sites can be a pain with FTP. Slate contains a bash script to help you push new changes up fast and accurately.

You can use the bashscript included with Slate to test deploys and actually do them to both a live server, and a staging server. For it to work, you may need to make it executable. To do this, head to the project root and run the following command:

$ chmod +x deploy.sh

Secondly, you need to configure the bashscript to work with your folder structure and server paths. Open up deploy.sh. There are six lines similar to this one that need to be ammended:

./public/ USER@12.34.5.678:/var/www/vhosts/domain.com/httpdocs

Once ammended, this will push files from ./public/ relative to your project root, and in the case of the content sync command, it will pull down from the server in the opposite direction.

Running a deploy

To test the files that will get deployed without actually deploying them, you can run either yarn deploy:staging:sim or deploy:live:sim. This will output the intended transfer in your terminal window.

Once your happy with the output, you can perform the deploy for real with yarn deploy:staging or deploy:live.

Deploy command reference

Command Result
deploy:live:sim Simulates a live deploy. No files transferred, report displayed in console.
deploy:live Performs a live deploy.
deploy:staging:sim Simulates a staging deploy. No files transferred, report in console.
deploy:staging Performs a staging deploy.
content:sync:sim Simulates syncing content down from live into your local copy. Useful for flat file CMS systems.
content:sync Syncs content down from live into your local copy. Useful for flat file CMS systems.

Built with the Best

Slate was built by Hash&Salt, a company who loves building for the internet. Using the very best in industry leading software and practices honed over the last 20 years in the industry. You're in good hands.