-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (33 loc) · 968 Bytes
/
deploy.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
name: 🚀 Deploy Backend
on:
workflow_dispatch:
push:
branches: [main]
jobs:
build-deploy:
name: 🎉 Build and Deploy Backend
runs-on: ubuntu-latest
steps:
- name: 🚚 Get latest code
uses: actions/checkout@v2
- name: 🔨 Set up Node 16
uses: actions/setup-node@v2
with:
node-version: 16.x
- name: 🛠 Compile Backend
run: |
cd server
npm ci
npm run build
cd ..
mkdir -p deploy/server/dist
cp -r server/dist deploy/server
cp server/* deploy/server || :
- name: ☁ SFTP Deploy
uses: easingthemes/ssh-deploy@v2
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
REMOTE_USER: ${{ secrets.REMOTE_USER }}
TARGET: "/home/${{ secrets.REMOTE_USER }}/PredictionsContest/"
SOURCE: "deploy/server/"