Overview
I am to establish a robust WordPress Development Process utilizing the following tools:
The goal is to deploy the entire site, including the WordPress core and plugins. I'm using Composer to handle this task.
Challenges
I'm currently facing two primary challenges:
WPEngine Directive Limitation:
- WPEngine support informed me that they do not allow modifications to the
root
directive. However, they mentioned that rule rewrites or additions are permissible, citing the example of rules for thewebp optimizer
plugin.
- WPEngine support informed me that they do not allow modifications to the
GitHub Action Error:
- During the GitHub Action process, I encounter an error that says:
'wp-config.php' not found.
Either create one manually or use 'wp config create'
- It's puzzling since the
bedrock
setup has awp-cli.yml
configuration pointing to a different path:path: web/wp server: docroot: web
GitHub Action Configuration
Here's my current GitHub Action setup:
name: Deploy to WPE Production Environment
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: php-actions/composer@v6
- name: Deploy to WP Engine
uses: wpengine/github-action-wpe-site-deploy@v3
with:
WPE_SSHG_KEY_PRIVATE: ${{ secrets.WPE_KEY }}
WPE_ENV: example
SRC_PATH: ""
REMOTE_PATH: ""
PHP_LINT: FALSE
FLAGS: -azvr --inplace --delete --exclude=".*" --exclude-from=.deployignore
CACHE_CLEAR: TRUE
Local Development Experience
For local WordPress project development, I rely on the Local by FlyWheel
tool. This allows for an easy change of the root
directive:
root "{{root}}";
root "{{root}}/web";
However, my attempt to rewrite the root
directive led to a 502 error:
server {
listen {{port}};
root {{root}};
location / {
try_files $uri @new_root;
}
location @new_root {
rewrite ^ /web$uri;
}
}
Research & Possible Solutions
Though I've scoured numerous resources to alter the direction of wp-config
, I haven't found a viable solution yet. I'm open to suggestions.
One thought is to potentially craft a custom deployment script to bridge WPE & Bedrock
.
Additional References
- WPE Action site deploy (by an external author): Link
- WPE Action site deploy: Link
- Older deployment script from 2016 for themes: Link
Any input or assistance would be greatly appreciated.