Developing Custom WordPress Themes and Plugins with Shifter (Using the GitHub Integration Plugin)

Shifter supports custom themes, but when developing custom WordPress themes on Shifter, there are a few tips and precautions to keep in mind to make the process easier.

Custom Theme Workflow: The Ideal Setup for a Custom WordPress Theme:

  • Develop locally using Shifter-Local
  • If necessary, use AIO WP Migration to migrate database changes and uploads
  • Track theme changes via Git
  • Use the GitHub integration plugin to deploy theme changes tracked in Git

In this guide, we’ll use the sample repository shifter-github-hosting-theme-sample. Feel free to clone or fork it locally.

Procedure

  1. [GitHub] Create a theme or plugin repository, or fork the sample repository If you forked the sample repository, make sure `release.yml` is available.

  2. [GitHub] Enable GitHub Actions in the repository. Click the [I understand my workflows, go ahead and run them] button “GitHub Actions” will be enabled.

  3. Create a new workflow or use the sample workflow (release.yml). Click the [New workflow] button. Click [Set up workflow yourself]. Create and save the workflow file. If you have forked the sample repository, make sure that `release.yml` is available.

  4. [GitHub] Clone the repository locally.

    $ git clone git@github.com:YOUR-ACCOUNT/YOUR-REPOSITORY.git ~/git/YOUR-REPOSITORY

  5. [Github] Copy the repository URL

  6. [Shifter] Launch WordPress and log in.

  7. [Shifter] Install the theme or plugin from Custom Themes to Shifter. [Appearance] –> Go to [Add New from GitHub]

  8. Shifter GitHub Install the plugin or theme using the Theme/Plugin Installer. Paste the GitHub repository URL into the [GitHub repo URL] field. If the repository is private, also enter the access token in the [GitHub token] field. Next, click [Install Now]

  9. Verify that [Shifter] has been installed

  10. [GitHub] Create and deploy a tagged release package. After updating the repository, create and deploy a release package.

    CLI

    $ git tag 2 (#cb2-2) $ git push origin 2

    Web Browser

    1. Go to [releases] in the [Code] tab
    2. Click the [Draft a new release] button
    3. Enter the version number in the [Tag version] field and click [Publish Release]
  11. Return to the [Actions] tab and verify that GitHub Actions is running. This may take a few minutes to complete.

  12. [Shifter] Log back into Shifter, go to the Updates page, and verify that the update is ready

  13. [Shifter] Apply the update and verify that it works

  14. [Shifter] Build and deploy the artifact