
In the dynamic world of WordPress development, efficiency and automation are key to staying ahead. Deploying your theme to the WordPress.org repository can be a meticulous process, but with GitHub Actions, you can automate and streamline this workflow. This guide will walk you through setting up GitHub Actions to deploy your WordPress.org theme, addressing common questions, and providing valuable insights to enhance your development process.
GitHub Actions is a powerful tool that enables developers to automate, customize, and enhance their software development workflows directly within GitHub. For WordPress theme developers, this means you can automate the deployment of your themes to the WordPress.org repository, reducing manual effort and minimizing errors.
By leveraging GitHub Actions, you can set up a continuous integration and deployment (CI/CD) pipeline that automatically pushes your theme updates to the WordPress.org repository whenever you create a new release. This not only saves time but also ensures that your users always have access to the latest features and improvements.
To deploy your WordPress theme using GitHub Actions, follow these steps:
Ensure your theme’s code is hosted on GitHub and that your repository follows the standard structure. This includes having a style.css file with the necessary theme headers and a functions.php file.
.distignore FileThe .distignore file specifies which files and directories should be excluded from the deployment. Common exclusions include development files, tests, and configuration files not required for the theme’s functionality. For example:
node_modules/
tests/
.gitignore
package.json
To authenticate with the WordPress.org Subversion (SVN) repository, you’ll need to set up the following secrets in your GitHub repository:
SVN_USERNAME: Your WordPress.org username.SVN_PASSWORD: Your WordPress.org password.To add these secrets, navigate to your repository’s settings, select “Secrets and variables,” then “Actions,” and click on “New repository secret.”
In your repository, create a .github/workflows/deploy.yml file with the following content:
name: Deploy Theme to WordPress.org
on:
push:
tags:
- '*'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: WordPress.org Theme Deploy
uses: actions/wordpress-theme-deploy@v1.0
env:
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SLUG: your-theme-slug
This workflow triggers on every push to a tag (e.g., when you create a new release). It checks out your repository and uses the wordpress-theme-deploy action to deploy your theme to WordPress.org. Ensure you replace your-theme-slug with your actual theme slug.
If your theme requires a build process (e.g., compiling Sass or JavaScript), you can add steps before the deployment step in your workflow. For example:
- name: Install Dependencies
run: npm install
- name: Build Assets
run: npm run build
These steps ensure that your assets are built before the theme is deployed.
Yes, you can configure the workflow to trigger on specific branches by modifying the on section:
on:
push:
branches:
- main
This configuration triggers the workflow only when changes are pushed to the main branch.
The .distignore file is used to exclude files and directories from deployment. Ensure this file is in your repository’s root and lists all items to be excluded.
Storing credentials as GitHub Secrets is a secure practice. GitHub encrypts and stores these secrets securely, making them accessible only to workflows in your repository.
If the deployment fails, GitHub Actions provides logs that can help you diagnose the issue. Common issues include incorrect SVN credentials, network problems, or issues with the theme’s code.
Automating your WordPress theme deployment using GitHub Actions can significantly enhance your development workflow, ensuring efficiency, accuracy, and consistency. By following the steps outlined in this guide, you can set up a robust deployment pipeline that saves time and reduces the potential for errors.

I’m Kamal, a WordPress developer focused on plugins, APIs, and scalable products.
Learn More