This GitHub Action deploys themes to WordPress servers hosted on WP Engine.
You’ll need to Read The Fine Source for this one. There are quite a few of them. Most are required.
Because both source-path
and remote-path
are passed to rsync
, it may be helpful to understand its rules for trailing slashes on paths. From the USAGE section of the rsync
manpage:
A trailing slash on the source changes this behavior to avoid creating an additional directory level at the destination. You can think of a trailing / on a source as meaning “copy the contents of this directory” as opposed to “copy the directory by name”, but in both cases the attributes of the containing directory are transferred to the containing directory on the destination. In other words, each of the following commands copies the files in the same way, including their setting of the attributes of /dest/foo:
rsync -av /src/foo /dest rsync -av /src/foo/ /dest/foo
You will want a file named .deployignore
in the root of the source directory (specified in source-path
).
It is expected that the .deployignore
file is formatted as an rsync(1) filter-rules file. This file will be passed to rsync via its --exclude-from
parameter.
While the .deployignore
file can be empty, you will want to add node_modules
to it as an exclusion (-
) if you ever plan on using Node-based anything in the repository:
- node_modules
If you’re having trouble getting uploads to go into the right place, there are a couple rsync flags that may be handy to diagnose problems:
--itemize-changes
(have a look at the manpage to understand its terse output)--dry-run
: computes changes, but doesn’t actually upload anything