-
-
Notifications
You must be signed in to change notification settings - Fork 33
42 lines (37 loc) · 1.32 KB
/
deploy-prod.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
35
36
37
38
39
40
41
42
name: Deploy to Production (on VPS)
on:
push:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# source: https://stackoverflow.com/a/65698892
# triggers this deployment after scaper runs
# for now this might have superfluous runs because the
# scraper will run and not commit anything, but after #215 is solved
# then it should only run after castablasta pushes a new episode
workflow_run:
workflows: ["Scrape and commit"]
types:
- completed
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Build
- name: Pull latest changes on VPS
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.VPS_HOST }}
USERNAME: ${{ secrets.VPS_DEPLOY_USER }}
PORT: ${{ secrets.VPS_SSH_PORT }}
KEY: ${{ secrets.VPS_SSHKEY }}
script: cd ${{ secrets.VPS_PROJECT_PATH }} && git pull
- name: Deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.VPS_HOST }}
USERNAME: ${{ secrets.VPS_DEPLOY_USER }}
PORT: ${{ secrets.VPS_SSH_PORT }}
KEY: ${{ secrets.VPS_SSHKEY }}
script: cd ${{ secrets.VPS_PROJECT_PATH }} && make deploy-prod