-
Notifications
You must be signed in to change notification settings - Fork 5
59 lines (53 loc) · 1.62 KB
/
deployment.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
name: Deploy
on:
push:
tags:
- v*
env:
SSH_USER: ${{ secrets.SSH_USER }}
SSH_HOST: ${{ secrets.SSH_HOST }}
jobs:
deploy:
name: Deploy WordPress Theme on Digital Ocean
runs-on: ubuntu-20.04
environment: production
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set SSH Connection
run: |
mkdir -p ~/.ssh/
echo "$SSH_KEY" > ~/.ssh/deploy.key
chmod 600 ~/.ssh/deploy.key
cat >>~/.ssh/config <<END
Host digitalocean
HostName $SSH_HOST
User $SSH_USER
IdentityFile ~/.ssh/deploy.key
StrictHostKeyChecking no
END
env:
SSH_KEY: ${{ secrets.DEPLOY_KEY }}
- name: Sync theme files
run: "rsync --delete -avO
--exclude /deploy_key \
--exclude /.git/ \
--exclude /.github/ \
--exclude /node_modules/ \
--exclude /vendor/ \
--exclude .babelrc \
--exclude .eslintrc.json \
--exclude .gitignore \
--exclude .phpcs.xml \
--exclude .stylelintrc.json \
--exclude CHANGELOG.md \
--exclude composer.json \
--exclude composer.lock \
--exclude package.json \
--exclude package-lock.json \
--exclude README.md \
--exclude webpack.config.js \
./ ${{ env.SSH_USER }}@${{ env.SSH_HOST }}:${{ env.DEST }}"
env:
SSH_HOST: digitalocean
DEST: "/var/www/base-wp-theme/wp-content/themes/base-wp-theme"