-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (46 loc) · 1.61 KB
/
wpengine-deploy.yml
File metadata and controls
54 lines (46 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: WP Engine Git Deploy
on:
push:
branches:
- main
- development
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "14"
- uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
working-directory: ./
run: npm ci
- name: Build
working-directory: ./
run: npm run build && rm -rf node_modules
- name: Git fetch
run: git fetch --prune --unshallow
- name: Set environment to production
if: endsWith(github.ref, '/main') ## Production Branch name
run: |
echo "WPE_ENVIRONMENT_NAME=${{ secrets.WPE_PROD_ENV_NAME }}" >> $GITHUB_ENV
echo "WPE_LOCAL_BRANCH=main" >> $GITHUB_ENV
- name: Set environment to development
if: endsWith(github.ref, '/development') ## Development Branch Name
run: |
echo "WPE_ENVIRONMENT_NAME=${{ secrets.WPE_DEV_ENV_NAME }}" >> $GITHUB_ENV
echo "WPE_LOCAL_BRANCH=development" >> $GITHUB_ENV
- name: Push to WP Engine
uses: epogeedesign/github-action-wpengine-git-deploy@master
env:
WPE_SSH_KEY_PRIVATE: ${{ secrets.WPE_SSH_KEY_PRIVATE }}
WPE_SSH_KEY_PUBLIC: ${{ secrets.WPE_SSH_KEY_PUBLIC }}
WPE_GIT_INCLUDE: ".github/wpe-git-include.txt"
WPE_GIT_EXCLUDE: ".github/wpe-git-exclude.txt"