-
Notifications
You must be signed in to change notification settings - Fork 22
38 lines (34 loc) · 1.05 KB
/
Copy pathdeploy-vps.yml
File metadata and controls
38 lines (34 loc) · 1.05 KB
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
36
37
38
name: Deploy Leaderboard Worker to VPS
on:
workflow_run:
workflows: ["Leaderboard Worker GHCR Image"]
types:
- completed
branches:
- main
workflow_dispatch:
permissions:
contents: read
jobs:
deploy:
name: Deploy to VPS
runs-on: ubuntu-latest
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
timeout-minutes: 10
env:
VPS_HOST: ${{ secrets.VPS_HOST }}
VPS_USER: ${{ secrets.VPS_USER }}
VPS_SSH_KEY: ${{ secrets.VPS_SSH_KEY }}
VPS_SSH_PORT: ${{ secrets.VPS_SSH_PORT || '22' }}
steps:
- name: Deploy via SSH
if: ${{ env.VPS_HOST != '' && env.VPS_USER != '' && env.VPS_SSH_KEY != '' }}
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ env.VPS_HOST }}
username: ${{ env.VPS_USER }}
key: ${{ env.VPS_SSH_KEY }}
port: ${{ env.VPS_SSH_PORT }}
script: |
cd ~/projects/DevImpact || cd /app || exit 1
bash ops/deploy/deploy-leaderboard.sh