-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (29 loc) · 1.13 KB
/
website.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
name: Deploy WordPress DEV
on:
push:
branches:
- develop # Replace 'main' with your preferred branch if necessary
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PKEY_PUB }}
- name: Sync WordPress Files to Server
env:
RSYNC_OPTIONS: '-avz --delete'
DEPLOY_PATH: '/opt/website/' # Replace with your server path
SERVER_USER: 'root' # Replace with your server username
SERVER_HOST: '177.92.144.247' # Replace with your server hostname or IP
run: |
rsync $RSYNC_OPTIONS ./ ${{ env.SERVER_USER }}@${{ env.SERVER_HOST }}:${{ env.DEPLOY_PATH }}
- name: Run WordPress Deployment Script
env:
SERVER_USER: 'root' # Replace with your server username
SERVER_HOST: '177.92.144.247' # Replace with your server hostname or IP
run: |
ssh ${{ env.SERVER_USER }}@${{ env.SERVER_HOST }} "cd ${{ env.DEPLOY_PATH }} && ./deploy.sh"