Last active
October 13, 2025 20:27
-
-
Save yan-kisen/39753efffa8b1cb2d3f29bb718730380 to your computer and use it in GitHub Desktop.
`wp-engine` GitHub Action Setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # FILE_PATH: `/.deployignore` | |
| ## NOTE: files to be ignored should be absolute FROM the `SRC_PATH` `<project_root>/wp-content/themes/ignore-me.txt` | |
| /ignore-me.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # FILE_PATH: `/.github/workflows/wpengine-stage.yml` | |
| name: Deploy to WP Engine | |
| on: | |
| push: | |
| branches: | |
| - develop | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: GitHub Action Deploy to WP Engine | |
| uses: wpengine/github-action-wpe-site-deploy@v3 | |
| # Ref: https://github.com/wpengine/github-action-wpe-site-deploy | |
| with: | |
| # Deploy vars | |
| WPE_SSHG_KEY_PRIVATE: ${{ secrets.WPE_SSHG_KEY_PRIVATE }} | |
| WPE_ENV: ${{vars.WPE_ENV_STAGE}} | |
| # Deploy Options | |
| SRC_PATH: "wp-content/themes/<theme_dir>/" | |
| REMOTE_PATH: "wp-content/themes/<theme_dir>/" | |
| PHP_LINT: FALSE | |
| ## RSYNC Flags | |
| FLAGS: -azvr --inplace --delete --exclude=.* --exclude-from=.deployignore | |
| #### NOTE: `.deployignore` should be in the repository root & all files therein should be absolute starting at the `SRC_PATH` (with leading slash) | |
| ## Remote bash file to execute post-deploy. This can include WP_CLI commands for example. Path is relative to the WP root and file executes on remote. This file can be included in your repo, or be a persistent file that lives on your server. | |
| # SCRIPT: "path/yourscript.sh" | |
| CACHE_CLEAR: TRUE |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
References:
Configuration Steps.
WPE_SSHG_KEY_PRIVATERepository Secreta. https://wpengine.com/support/ssh-keys-for-shell-access/#Generate_New_SSH_Key
.github/workflows/wpengine-stage.yml&.github/workflows/wpengine-prod.ymla. Update
branchesaccordinglyWPE_ENV_STAGE&WPE_ENV_MAINto correspond toWP Engineenvironment names