Automating Theme Deployment with GitHub Actions and sFTP

Automating Theme Deployment with GitHub Actions and sFTP

When developing WordPress themes or other projects that require automated deployment from GitHub to a server via sFTP, GitHub Actions offers a convenient and efficient solution. Among the available options, I’ve found this action to be the most user-friendly and straightforward:

https://github.com/marketplace/actions/sftp-deploy

For themes developed using underscoretw.com, it’s recommended to run the build command (npm run prod) before deployment to minimize file sizes and optimize the theme for production.

To illustrate the process, I’ve created an example YAML file that demonstrates the configuration of the sFTP deploy action:

deploy-sftp.yml →

Facebook Post