Skip to content

Commit 20543db

Browse files
authored
Merge pull request #109 from MichaelMrt/dev
added GitHub Actions workflow to pull changes on remote server
2 parents 479dc49 + da919fb commit 20543db

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Pull changes on remote server
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v2
14+
15+
- name: Setup SSH
16+
run: |
17+
mkdir -p ~/.ssh
18+
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
19+
chmod 600 ~/.ssh/id_rsa
20+
ssh-keyscan -H "${{ secrets.REMOTE_HOST }}" >> ~/.ssh/known_hosts
21+
22+
23+
- name: Pull latest changes on remote server
24+
run: |
25+
ssh ${{ secrets.REMOTE_USER }}@${{ secrets.REMOTE_HOST }} '
26+
cd /var/www/ChessPHP && git pull origin main
27+
'

0 commit comments

Comments
 (0)