Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bhubbard/895435d42d6b54aaab608f0b02657921 to your computer and use it in GitHub Desktop.
Save bhubbard/895435d42d6b54aaab608f0b02657921 to your computer and use it in GitHub Desktop.
# This is a workflow to compile and deploy to WPEngine Production
name: PROD Deploy to WPEngine
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the release-1 branch
push:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Setup Node.js environment
uses: actions/setup-node@v2.2.0
with:
# Version Spec of the version to use. Examples: 12.x, 10.15.1, >=10.15.0
node-version: '14.6'
- run: cd project/themes/your-theme && npm install
- name: Compile production assets
run: cd project/themes/your-theme && npm run build
- name: Remove node_modules
run: cd project/themes/your-theme && rm -Rf node_modules
- name: Deploy WordPress to WP Engine
# You may pin to the exact commit or the version.
# uses: wpengine/github-action-wpe-site-deploy@78e54ef1e8ce6591267521095a03e304a2b837f1
uses: wpengine/github-action-wpe-site-deploy@main
env:
# Keys, lint & url options
WPE_SSHG_KEY_PRIVATE: ${{ secrets.WPENGINE_SSH_KEY_PRIVATE }}
PHP_LINT: FALSE
TPO_SRC_PATH: "project/*"
TPO_PATH: "wp-content"
# Branches & Environments
PRD_BRANCH: main
PRD_ENV: yoursitename
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment