-
-
Notifications
You must be signed in to change notification settings - Fork 3
34 lines (27 loc) · 1.04 KB
/
deploy.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 on Kinsta
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Add GitHub to known hosts
run: |
ssh-keyscan -H github.com >> ~/.ssh/known_hosts
- name: Check SSH connection
run: |
ssh -o StrictHostKeyChecking=no -A ${{ secrets.SSH_USER_HOST }} -p ${{ secrets.SSH_PORT }} "echo 'SSH connection successful'"
- name: Verify forwarded SSH key on remote server
run: |
ssh -o StrictHostKeyChecking=no -A ${{ secrets.SSH_USER_HOST }} -p ${{ secrets.SSH_PORT }} 'ssh-add -l'
- name: Run git pull on the remote server
run: |
ssh -o StrictHostKeyChecking=no -A ${{ secrets.SSH_USER_HOST }} -p ${{ secrets.SSH_PORT }} 'cd public && git pull && composer install --no-dev --no-scripts ; wp plugin activate --all'