-
Notifications
You must be signed in to change notification settings - Fork 4
74 lines (72 loc) · 2.68 KB
/
server.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Build server
on:
push:
paths:
- '.github/workflows/server.yml'
- 'src/**'
- 'build.sbt'
- '.sbtopts.default'
pull_request:
paths:
- '.github/workflows/server.yml'
- 'src/**'
- 'build.sbt'
- '.sbtopts.default'
jobs:
openjdk14:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.sbt
~/.ivy2/cache
key: ${{ runner.os }}-sbt-${{ hashFiles('**/project/build.properties') }}-${{ hashFiles('**/build.sbt') }}-${{ hashFiles('**/project/Dependencies.scala') }}
- uses: actions/setup-java@v2
with:
distribution: zulu
java-version: 14.0.1
- run: sbt -Depoll=true "test;stage"
- run: cp LICENSE README.md target/universal/stage && git log -n 1 --pretty=oneline > target/universal/stage/commit.txt
- run: cd target/universal/stage && tar -cvpJf ../../../lila-ws-3.0.tar.xz . && cd -
env:
XZ_OPT: '-0'
- uses: actions/upload-artifact@v1
with:
name: lila-ws
path: lila-ws-3.0.tar.xz
- name: Master -- Copy file to server
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
uses: appleboy/scp-action@master
with:
host: ${{ secrets.PS_MAIN_HOST }}
username: ${{ secrets.PS_MAIN_USERNAME }}
key: ${{ secrets.MSO_CI_SSH_KEY }}
source: 'lila-ws-3.0.tar.xz'
target: '/tmp/'
- name: Master -- Upgrade application
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
uses: garygrossgarten/github-action-ssh@release
with:
command: /opt/lila/upgrade.sh lila-ws /tmp/lila-ws-3.0.tar.xz
host: ${{ secrets.PS_MAIN_HOST }}
username: ${{ secrets.PS_MAIN_USERNAME }}
privateKey: ${{ secrets.MSO_CI_SSH_KEY }}
- name: Dev -- Copy file to server
if: github.ref == 'refs/heads/dev' && github.event_name == 'push'
uses: appleboy/scp-action@master
with:
host: ${{ secrets.PSD_MAIN_HOST }}
username: ${{ secrets.PSD_MAIN_USERNAME }}
key: ${{ secrets.MSO_CI_SSH_KEY }}
source: 'lila-ws-3.0.tar.xz'
target: '/tmp/'
- name: Dev -- Upgrade application
if: github.ref == 'refs/heads/dev' && github.event_name == 'push'
uses: garygrossgarten/github-action-ssh@release
with:
command: /opt/lila/upgrade.sh lila-ws /tmp/lila-ws-3.0.tar.xz
host: ${{ secrets.PSD_MAIN_HOST }}
username: ${{ secrets.PSD_MAIN_USERNAME }}
privateKey: ${{ secrets.MSO_CI_SSH_KEY }}