Skip to content

Commit 85ed50d

Browse files
committed
add deploy script
1 parent 5ca3934 commit 85ed50d

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Deploy on master merge
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
deploy:
11+
runs-on: ubuntu-latest
12+
env:
13+
DEPLOY_SERVER: 193.2.72.46
14+
DEPLOY_USER: notes-deploy-user
15+
16+
steps:
17+
- name: Set up SSH key
18+
run: |
19+
mkdir -p ~/.ssh
20+
echo "${{ secrets.SSH_NOTES_DEPLOY_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
21+
chmod 600 ~/.ssh/id_ed25519
22+
23+
ssh-keyscan -H $DEPLOY_SERVER >> ~/.ssh/known_hosts
24+
25+
- name: Trigger deploy script over SSH
26+
run: |
27+
ARGS=""
28+
if [ "${{ github.event_name }}" = "pull_request" ]; then
29+
ARGS="${{ github.head_ref }}"
30+
fi
31+
ssh -o StrictHostKeyChecking=yes $DEPLOY_USER@$DEPLOY_SERVER "${{ github.repository }}" $ARGS

0 commit comments

Comments
 (0)