-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (53 loc) · 1.55 KB
/
master.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Production build
on:
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Set up Node 12
uses: actions/setup-node@v1
with:
node-version: 12
- run: npm install
working-directory: frontend
- name: Frontend Build
run: npm run build
working-directory: frontend
- name: Check format
run: sbt scalafmtCheckAll
- name: Run Scala tests
run: sbt test
- name: Scala production build
run: sbt "project rest" dist
- name: Deploy to Uberspace
uses: easingthemes/[email protected]
env:
SSH_PRIVATE_KEY: ${{ secrets.DEPLOYMENT_SSH_PRIVATE_KEY }}
REMOTE_HOST: ${{ secrets.DEPLOYMENT_SSH_HOST }}
REMOTE_USER: ${{ secrets.DEPLOYMENT_SSH_USER }}
SOURCE: rest/target/universal/yaniv-*.zip
TARGET: /home/${{ secrets.DEPLOYMENT_SSH_USER }}/yaniv
ARGS: "-rltgoDzvO --delete"
- name: Restart production service
uses: appleboy/[email protected]
with:
host: ${{ secrets.DEPLOYMENT_SSH_HOST }}
username: ${{ secrets.DEPLOYMENT_SSH_USER }}
key: ${{ secrets.DEPLOYMENT_SSH_PRIVATE_KEY }}
script: |
cd yaniv
supervisorctl stop yaniv
rm -rf current
unzip -o yaniv-*.zip
rm yaniv-*.zip
mv yaniv-* current
supervisorctl start yaniv
script_stop: true
debug: true