https://github.com/jovrtn/github-action-wpengine-git-deploy
An action to deploy your repository to a WP Engine site via git.
https://github.com/jovrtn/github-action-wpengine-git-deploy
wpengine
Last synced: 2 months ago
JSON representation
An action to deploy your repository to a WP Engine site via git.
- Host: GitHub
- URL: https://github.com/jovrtn/github-action-wpengine-git-deploy
- Owner: jovrtn
- Created: 2019-03-12T02:36:27.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2021-12-11T00:09:16.000Z (over 4 years ago)
- Last Synced: 2023-10-20T20:51:24.485Z (over 2 years ago)
- Topics: wpengine
- Language: Shell
- Homepage:
- Size: 18.6 KB
- Stars: 45
- Watchers: 5
- Forks: 47
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# THIS PROJECT IS UNMAINTAINED -- USE AT YOUR OWN RISK. PLEASE FORK OR SEE ONE OF THE EXISTING FORKS FOR A MORE UPDATED VERSION.
# GitHub Action for WP Engine Git Deployments
An action to deploy your repository to a **[WP Engine](https://wpengine.com)** site via git. [Read more](https://wpengine.com/git/) about WP Engine's git deployment support.
## Example GitHub Action workflow
```
workflow "Deploy to WP Engine" {
on = "push"
resolves = ["Git Push to Production"]
}
action "Git Push to Production" {
uses = "jovrtn/github-action-wpengine-git-deploy@master"
env = {
WPENGINE_ENVIRONMENT_NAME = "my-cool-site-production"
}
secrets = [
"WPENGINE_SSH_KEY_PRIVATE",
"WPENGINE_SSH_KEY_PUBLIC"
]
}
```
## Environment Variables & Secrets
### Required
| Name | Type | Usage |
|-|-|-|
| `WPENGINE_ENVIRONMENT_NAME` | Environment Variable | The name of the WP Engine environment you want to deploy to. |
| `WPENGINE_SSH_KEY_PRIVATE` | Secret | Private SSH key of your WP Engine git deploy user. See below for SSH key usage. |
| `WPENGINE_SSH_KEY_PUBLIC` | Secret | Public SSH key of your WP Engine git deploy user. See below for SSH key usage. |
### Optional
| Name | Type | Usage |
|-|-|-|
| `WPENGINE_ENVIRONMENT` | Environment Variable | Defaults to `production`. You shouldn't need to change this, but if you're using WP Engine's legacy staging, you can override the default and set to `staging` if needed. |
| `LOCAL_BRANCH` | Environment Variable | Set which branch in your repository you'd like to push to WP Engine. Defaults to `master`. |
### Further reading
* [Defining environment variables in GitHub Actions](https://developer.github.com/actions/creating-github-actions/accessing-the-runtime-environment/#environment-variables)
* [Storing secrets in GitHub repositories](https://developer.github.com/actions/managing-workflows/storing-secrets/)
## Setting up your SSH keys
1. [Generate a new SSH key pair](https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/) as a special deploy key. The simplest method is to generate a key pair with a blank passphrase, which creates an unencrypted private key.
2. Store your public and private keys in your GitHub repository as new 'Secrets' (under your repository settings), using the names `WPENGINE_SSH_KEY_PRIVATE` and `WPENGINE_SSH_KEY_PUBLIC` respectively. In theory, this replaces the need for encryption on the key itself, since GitHub repository secrets are encrypted by default.
3. Add the public key to your target WP Engine environment.
4. Per the [WP Engine documentation](https://wpengine.com/git/), it takes about 30-45 minutes for the new SSH key to become active.