-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (33 loc) · 971 Bytes
/
main.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
name: Deploy Main
on:
push:
branches: [ main ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Sync
env:
dest: '${{vars.USER}}@${{vars.HOST}}:${{vars.THEMEPATHPROD}}'
run: |
echo "${{secrets.DEPLOY_KEY}}" > deploy_key
chmod 600 ./deploy_key
rsync -chav --delete \
-e 'ssh -i ./deploy_key -o StrictHostKeyChecking=no' \
--exclude /deploy_key \
--exclude /.git/ \
--exclude /.github/ \
--exclude /node_modules/ \
./ ${{env.dest}}
- name: SSH Remote Commands
uses: appleboy/[email protected]
with:
host: ${{vars.HOST}}
username: ${{vars.USER}}
key: ${{secrets.DEPLOY_KEY}}
script: |
cd ${{vars.THEMEPATHPROD}}
git checkout main
wp theme activate site-america-aberta --allow-root
wp nginx-helper purge-all --allow-root