All Projects → wpengine → github-action-wpe-site-deploy

wpengine / github-action-wpe-site-deploy

Licence: MIT license
A GitHub Action to deploy code directly to WP Engine.

Programming Languages

shell
77523 projects
Dockerfile
14818 projects
PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to github-action-wpe-site-deploy

action-deploy-aws-static-site
Batteries-included Github action that deploys a static site to AWS Cloudfront, taking care of DNS, SSL certs and S3 buckets
Stars: ✭ 70 (-39.66%)
Mutual labels:  actions, github-action
github-run-tests-action
mabl Github Actions implementation
Stars: ✭ 39 (-66.38%)
Mutual labels:  actions, github-action
qodana-action
⚙️ Scan your Java, Kotlin, PHP, Python, JavaScript, TypeScript projects at GitHub with Qodana
Stars: ✭ 112 (-3.45%)
Mutual labels:  actions, github-action
recent-activity
Add your recent activity to your profile readme!
Stars: ✭ 87 (-25%)
Mutual labels:  actions, github-action
Github Pages Deploy Action
Automatically deploy your project to GitHub Pages using GitHub Actions. This action can be configured to push your production-ready code into any branch you'd like.
Stars: ✭ 2,507 (+2061.21%)
Mutual labels:  deployment, github-action
ssh2actions
Connect to GitHub Actions VM via SSH for interactive debugging
Stars: ✭ 62 (-46.55%)
Mutual labels:  actions, github-action
build-godot-action
GitHub action that builds a Godot project for multiple platforms
Stars: ✭ 62 (-46.55%)
Mutual labels:  actions, github-action
clojure-dependency-update-action
A simple GitHub Actions job to create Pull Requests for outdated dependencies in clojure projects
Stars: ✭ 37 (-68.1%)
Mutual labels:  actions, github-action
jekyll-deploy-action
🪂 A Github Action to deploy the Jekyll site conveniently for GitHub Pages.
Stars: ✭ 162 (+39.66%)
Mutual labels:  deployment, actions
github-env-vars-action
🚀 GitHub Action for Environment Variables
Stars: ✭ 129 (+11.21%)
Mutual labels:  deployment, github-action
assign-one-project-github-action
Automatically add an issue or pull request to specific GitHub Project(s) when you create and/or label them.
Stars: ✭ 140 (+20.69%)
Mutual labels:  actions, github-action
action-dynamic-readme
~ Dynamic ReadME Generator ~
Stars: ✭ 29 (-75%)
Mutual labels:  actions, github-action
nrwl-nx-action
A GitHub Action to wrap Nrwl Nx commands in your workflows.
Stars: ✭ 163 (+40.52%)
Mutual labels:  actions, github-action
overview
Automate your workflows with GitHub actions for MATLAB.
Stars: ✭ 40 (-65.52%)
Mutual labels:  actions, github-action
standard-action
Github Action to lint with `standard` and friends
Stars: ✭ 15 (-87.07%)
Mutual labels:  actions, github-action
action-sync-node-meta
GitHub Action that syncs package.json with the repository metadata.
Stars: ✭ 25 (-78.45%)
Mutual labels:  actions, github-action
action-netlify-deploy
🙌 Netlify deployments via GitHub actions
Stars: ✭ 32 (-72.41%)
Mutual labels:  actions, github-action
setup-jdk
(DEPRECATED) Set up your GitHub Actions workflow with a specific version of AdoptOpenJDK
Stars: ✭ 32 (-72.41%)
Mutual labels:  actions, github-action
deployer-php-action
Deploy PHP projects using Deployer from Github Actions
Stars: ✭ 57 (-50.86%)
Mutual labels:  deployment, actions
action-my-broken-link-checker
A GitHub Action for checking broken links
Stars: ✭ 32 (-72.41%)
Mutual labels:  actions, github-action

WP Engine GitHub Actions Site Deployment

Test e2e Deploy to WP Engine Lint GHA Files Version and Release

WP Engine GitHub Action for Site Deployment

Use this GitHub Action to deploy code from a GitHub repo to a WP Engine environment of your choosing. If you do not have a WP Engine Account, click here to get started! If you do have an account, check out our guided step-by-step instructions.

This action enables you to:

  • Deploy a full site directory or subdirectory of your WordPress install
  • Perform a PHP Lint
  • Customize rsync flags
  • Clear cache
  • Execute a post-deploy script of your choosing

Setup Instructions

  1. SSH PUBLIC KEY SETUP IN WP ENGINE
  1. SSH PRIVATE KEY SETUP IN GITHUB
  1. YML SETUP
  • Create .github/workflows/main.yml directory and file locally. Copy and paste the configuration from below, replacing the value under branches: and the value for WPE_ENV:.

  • To deploy from another branch, simply create another yml file locally for that branch, such as .github/workflows/stage.yml and replace the values for branches: and WPE_ENV: for that workflow.

This provides the ability to perform a different workflow for different branches/environments. Consult "Environment Variable & Secrets" for more available options.

  1. Git push your site GitHub repo. The action will do the rest!

View your actions progress and logs by navigating to the "Actions" tab in your repo.

Example GitHub Action workflow

Simple main.yml:

name: Deploy to WP Engine
on:
  push:
    branches:
     - main
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: GitHub Action Deploy to WP Engine
      uses: wpengine/github-action-wpe-site-deploy@v3
      with:
        WPE_SSHG_KEY_PRIVATE: ${{ secrets.WPE_SSHG_KEY_PRIVATE }}
        WPE_ENV: <your_install_name_here>

Extended main.yml

name: Deploy to WP Engine
on:
  push:
    branches:
     - main
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: GitHub Action Deploy to WP Engine
      uses: wpengine/github-action-wpe-site-deploy@v3
      with:
      # Deploy vars
        WPE_SSHG_KEY_PRIVATE: ${{ secrets.WPE_SSHG_KEY_PRIVATE }}
        WPE_ENV: <your_install_name_here>
        # Deploy Options
        SRC_PATH: "wp-content/themes/genesis-child-theme/"
        REMOTE_PATH: "wp-content/themes/genesis-child-theme/"
        PHP_LINT: TRUE
        FLAGS: -azvr --inplace --delete --exclude=".*"  --exclude=wp-content/mu-plugins/local-plugin --exclude-from=ignorefile.txt
        SCRIPT: "path/yourscript.sh"
        CACHE_CLEAR: TRUE

Environment Variables & Secrets

Required

Name Type Usage
WPE_SSHG_KEY_PRIVATE secrets Private SSH Key for the SSH Gateway and deployment. See below for SSH key usage.

Deploy Options

Name Type Usage
WPE_ENV string Insert the name of the WP Engine environment you want to deploy to. This also has an alias of PRD_ENV, STG_ENV, or DEV_ENV for multi-step workflows.
SRC_PATH string Optional path to specify a directory within the repo to deploy from. Ex. "wp-content/themes/genesis-child-theme/". Defaults to root of repo filesystem as source.
REMOTE_PATH string Optional path to specify a directory destination to deploy to. Ex. "wp-content/themes/genesis-child-theme/" . Defaults to WordPress root directory on WP Engine.
PHP_LINT bool Set to TRUE to execute a php lint on your branch pre-deployment. Default is FALSE.
FLAGS string Set optional rsync flags such as --delete or --exclude-from. The example is excluding paths specified in a .deployignore file in the root of the repo. This action defaults to a non-destructive deploy using the flags in the example above.

Caution: Setting custom rsync flags replaces the default flags provided by this action. Consider also adding the -azvr flags as needed.
-a preserves symbolic links, timestamps, user permissions and ownership.
-z is for compression
-v is for verbose output
-r is for recursive directory scanning
SCRIPT string 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.
CACHE_CLEAR bool Optionally clear page and CDN cache post deploy. This takes a few seconds. Default is TRUE.

Further reading

Versioning

We follow SemVer and GitHub's action versioning recommendations for maintaining major, minor, and patch version tags. Patch tags (e.g. v1.1.1) are created for each release and will not move once created. Major tags (e.g. v1) and minor tags (e.g. v1.1) will be updated to track their respective latest versions.

We recommend binding this action to the latest major tag so that you will receive backwards compatible updates.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].