Skip to content

Latest commit

 

History

History
65 lines (51 loc) · 2.77 KB

fresh.md

File metadata and controls

65 lines (51 loc) · 2.77 KB

Steps to recreate your own theme on your own github repo

  1. Create a wp engine site if you don't already have one at wpengine.com. We'll use "your-wp-install-name" as an example.

  2. Back on your machine, create your install directory that'll house the wordpress theme

mkdir your-wp-install-name && cd your-wp-install-name
  1. Create the folder structure for the theme to ultimately be copied over
mkdir -p wp-content/themes && cd wp-content/themes
  1. Within the themes directory, create your new theme using composer
composer create-project roots/sage your-roots-theme-name-here
  1. With your new theme, you need acorn, the best way to install is also composer
cd your-roots-theme-name-here && composer require roots/acorn
  1. Add "post-autoload-dump" script that'll run after every composer update command to the composer.json

  2. Create the directory structure for the github action

mkdir -p .github/workflows/ && cd .github/workflows/
  1. Add the github action that'll deploy the theme
wget https://github.com/wpengine/example-sage-theme/blob/main/.github/workflows/action.yml
  1. Update just these sections of the action.yml file
name: Deploy to WP Engine
env:
  WPE_SSHG_KEY_PRIVATE: ${{ secrets.WPE_SSHG_KEY_PRIVATE }} # We'll add this later
  WPE_INSTALL_NAME: your-wp-install-name
  THEME_NAME: your-roots-theme-name-here
  1. Create and add an ssh-gateway private key to your repo's github secrets and the my.wpengine.com portal.

  2. Add a post-deploy.sh script to run wp-cli commands like, wp acorn view:cache to compile the Sage templates once deployed.

cd ../../ && wget https://github.com/wpengine/example-sage-theme/blob/main/post-deploy.sh
  1. And your done! With the action setup, it will now auto deploy and run the post-deploy.sh script. Just git commit and git push to your repo!










Still need help or have questions? Contact support!

Log in to your account to get expert one-on-one help, 24 hours a day, 7 days a week, 365 days a year.