Wordpress theme deployment guide
Deploying your WordPress theme with Git
This guide will walk you through deploying a WordPress theme to your server. There’s various ways to do this, in this case we’re going to assumed there’s already a WordPress installation on your server, and you have a Git repository containing your WordPress theme which you’d like to upload and publish.
Deploying with Launchdeck
Launchdeck is an automated code deployment tool that allows you to easily deploy code to your servers. You can write configuration files, define custom commands and deploy automatically whenever you push.
Our basic plan is free - including all our features and allows you to deploy 1 project unlimited times a day!
Create a project
Let’s get started by creating a new project and linking your Git account. All repositories within your account will be retrieved and shown as a list, from which you can now select the one you’d like to use.
Setup your build
The next step allows us to define commands which will be executed in an isolated docker container - this is the build step. You can use this step to, for example, compile theme assets, or, if you’re using composer, run
All files generated using these build commands will be uploaded to your server. Elsewhere in this guide, you’ll find more information on how to set up and use build commands.
Configure a server
Now let’s tell Launchdeck where to upload the theme. In this example, we’ll upload all your theme files directly to the theme folder on your server using FTP.
Hit ‘+ new server’, select FTP, and enter the credentials to your server. Next, enter the path to which your theme files should be uploaded. Assuming a regular WordPress directory structure, this would be ‘/wp-content/themes/yourtheme’, possibly prefixed by some path specific to your hosting account and/or the domain you are trying to deploy to.
Of course you may also choose to use an SSH/SFTP server instead, for example to deploy to hosting providers specializing in WordPress sites.
Deploy for the first time
We’re now ready to start our first deployment. Click ‘create new project’ to confirm the settings and add the project. In the project overview, you can now start the build. The code will be cloned from your repository and prepared for you to publish it. Hit ‘Publish’ and your WordPress theme is live!
If we then commit changes to our repository, the commit will automatically appear in your project overview where you’ll be able to upload and publish your new version with the push of a button. If anything goes wrong, you can simply roll back to the latest working version.
Launchdeck has a variety of useful features to help you deploy your WordPress site:
- Automating tasks such as installing dependencies, transpiling code and running tests using build commands
- Running SSH commands, using tools such as WP-CLI to perform backups, update the WordPress core, or migrate databases after the upload.
- Keep sensitive information such as database credentials in your wp-config.php file safely excluded from your repository using configuration files.