-
Notifications
You must be signed in to change notification settings - Fork 2
/
action.yml
112 lines (87 loc) · 3.57 KB
/
action.yml
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Deploy to WP Engine
description: |
Deploys files to WP Engine.
It can also, at your option:
- Compile CSS with Grunt or Gulp and commit the changes back to the repository
- Purge the Cloudflare cache in front of the site
inputs:
wpengine-ssh-gateway-key-private:
required: true
description: |
The private SSH key that you use to connect to the WPEngine SSH Gateway.
You should pass this in from something like `secrets.WPE_SSHG_KEY_PRIVATE`.
environment-name:
required: true
description: The name of your WP Engine install.
source-path:
required: true
description: |
The source path to the theme you want to upload.
This will be something like “wp-content/themes/your-child-theme”, or possibly “.”.
remote-path:
required: true
description: |
The remote destination path of the theme you want to upload.
This will be something like “wp-content/themes/your-child-theme”, or possibly “.”.
compile-and-commit:
required: true
default: false
description: |
If true, builds the project with Grunt or Gulp and commits the changes (if any).
rsync-flags:
required: true
default: -azvr --inplace --delete --exclude=".*" --exclude-from=.deployignore
description: |
Command-line flags passed to rsync(1).
cloudflare-purge-urls:
required: false
description: |
A string containing a flow-style list (“'["https://a", "https://b"]'”) of URLs to purge from Cloudflare.
If this input is not specified, no purging will be attempted.
cloudflare-zone:
required: false
description: |
The Cloudflare zone to purge URLs from.
Frequently `secrets.CLOUDFLARE_ZONE`.
This will need to be set for `cloudflare-purge-urls` to work.
cloudflare-token:
required: false
description: |
The Cloudflare token used to purge URLs.
Frequently `secrets.CLOUDFLARE_TOKEN`.
This will need to be set for `cloudflare-purge-urls` to work.
runs:
using: composite
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Compile with Grunt
uses: elstudio/actions-js-build/build@v4
if: inputs.compile-and-commit == 'true' || inputs.compile-and-commit == true
- name: Commit changes
uses: elstudio/actions-js-build/commit@v4
if: inputs.compile-and-commit == 'true' || inputs.compile-and-commit == true
with:
commitMessage: Compile CSS
- name: Deploy to WP Engine
uses: wpengine/[email protected]
with:
# OpenSSH private keys are multiple lines long and start with “---”.
# `inputs` passing fails if we use the normal ${{ … }} expansion here. YAML literal style (“|”) fixes this.
WPE_SSHG_KEY_PRIVATE: |
${{ inputs.wpengine-ssh-gateway-key-private }}
WPE_ENV: ${{ inputs.environment-name }}
SRC_PATH: ${{ inputs.source-path }}
REMOTE_PATH: ${{ inputs.remote-path }}
PHP_LINT: true
FLAGS: ${{ inputs.rsync-flags }}
CACHE_CLEAR: true
- name: Purge Cloudflare cache
uses: jakejarvis/cloudflare-purge-action@master
if: ${{ join(inputs.cloudflare-purge-urls) != '' }}
env:
CLOUDFLARE_ZONE: ${{ inputs.cloudflare-zone }}
CLOUDFLARE_TOKEN: ${{ inputs.cloudflare-token }}
PURGE_URLS: ${{ inputs.cloudflare-purge-urls }}