Stackahoy

Deploying a WordPress Application

The following demonstrates how to setup a professional and maintainable deployment workflow for a WordPress application.

Best Practices

  • Don't commit compiled/minified CSS or JavaScript files. Do these post deployment directly on the server if you can. This will make for a more pleasurable experience working with a team with less conflicts.
  • Make sure all ephermal files are in .gitignore, just as you normally would.
  • Keep your database credentials in Stackahoy for easy management.
  • Keep core and plugin updates managed within your repository. Disabled automatic updates using the CMS to avoid unexpected problems.

This will make sure any ephemeral or configuration files are ignored during the deployment. This file will live at the root of the application.

This is taken dirctly from GitHub's .gitignore repository.

*.log
.htaccess
sitemap.xml
sitemap.xml.gz
wp-config.php
wp-content/advanced-cache.php
wp-content/backup-db/
wp-content/backups/
wp-content/blogs.dir/
wp-content/cache/
wp-content/upgrade/
wp-content/uploads/
wp-content/wp-cache-config.php
wp-content/plugins/hello.php


/readme.html
/license.txt

The most important lines here are wp-config.php and wp-content/uploads/.

Static Files

The static files feature is a great place to setup the wp-config.php file.