-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (46 loc) · 1.55 KB
/
wpengine-deploy-themes.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
name: Deploy plugins to WP Engine
on:
workflow_call:
inputs:
backup:
type: boolean
default: true
env_install:
type: string
required: true
env_ssh_host:
type: string
required: true
secrets:
known_hosts:
required: true
wpengine_ssh_key_private:
required: true
jobs:
backup:
runs-on: ubuntu-latest
if: ${{ inputs.backup }}
steps:
- uses: benoitchantre/[email protected]
with:
private-key: ${{ secrets.wpengine_ssh_key_private }}
private-key-name: deploy-wpengine
known-hosts: ${{ secrets.known_hosts }}
- run: ssh -i ~/.ssh/deploy-wpengine ${{ inputs.env_install }}@${{ inputs.env_ssh_host }} 'zip -r --filesync --test --display-bytes --display-counts sites/${{ inputs.env_install }}/_wpeprivate/backup-themes.zip sites/${{ inputs.env_install }}/wp-content/themes'
deploy:
runs-on: ubuntu-latest
needs: [ backup ]
if: always()
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- uses: benoitchantre/[email protected]
with:
private-key: ${{ secrets.wpengine_ssh_key_private }}
private-key-name: deploy-wpengine
known-hosts: ${{ secrets.known_hosts }}
- run: |
rsync -chaviP --delete --stats --no-times --no-perms \
-e 'ssh -i ~/.ssh/deploy-wpengine' \
wp-content/themes/ "${{ inputs.env_install }}@${{ inputs.env_ssh_host }}:/sites/${{ inputs.env_install }}/wp-content/themes"