Skip to content

Commit 68fd358

Browse files
committed
Add GitHub Actions deploy
1 parent b2ac21c commit 68fd358

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Deploy CacheFlow
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
workflow_dispatch:
9+
10+
jobs:
11+
deploy:
12+
name: Deploy to VPS
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Prepare SSH
17+
run: |
18+
mkdir -p ~/.ssh
19+
printf '%s\n' "${{ secrets.DEPLOY_SSH_KEY }}" > ~/.ssh/id_ed25519
20+
chmod 600 ~/.ssh/id_ed25519
21+
printf '%s\n' "${{ secrets.DEPLOY_KNOWN_HOSTS }}" > ~/.ssh/known_hosts
22+
chmod 644 ~/.ssh/known_hosts
23+
24+
- name: Run deploy script on server
25+
env:
26+
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
27+
DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
28+
run: |
29+
ssh "$DEPLOY_USER@$DEPLOY_HOST" 'cd /opt/myapp/CacheFlow && ./deploy.sh'

0 commit comments

Comments
 (0)