-
-
Notifications
You must be signed in to change notification settings - Fork 13
122 lines (120 loc) · 4.39 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: Build server
on:
push:
paths:
- '.github/workflows/server.yml'
- 'app/**'
- 'conf/**'
- 'modules/**'
- 'project/**'
- 'translation/**'
- 'build.sbt'
- 'lila'
- 'conf/application.conf.default'
- '.sbtopts.default'
#add front end options to ensure full build gets triggered
- 'public/**'
- 'ui/**'
- 'package.json'
- 'pnpm-lock.yaml'
branches-ignore:
- 'l10n_master'
pull_request:
paths:
- '.github/workflows/server.yml'
- 'app/**'
- 'conf/**'
- 'modules/**'
- 'project/**'
- 'translation/source/**'
- 'build.sbt'
- 'lila'
- 'conf/application.conf.default'
- '.sbtopts.default'
#add front end options to ensure full build gets triggered
- 'public/**'
- 'ui/**'
- 'package.json'
- 'pnpm-lock.yaml'
jobs:
openjdk17:
runs-on: ubuntu-20.04
steps:
- name: Check if organization member
id: check_org_member
uses: Mind-Sports-Games/check-org-member@v1.1.0
with:
username: ${{ github.actor }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Check Failed
if: ${{ steps.check_org_member.outputs.result == 'false' }}
run: |
echo User Does Not Belong to Mind-Sports-Games
exit 1
- name: Check Passed
run: echo The actor is an organization member
- uses: actions/checkout@v4
- uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ secrets.MSO_CI_SSH_KEY }}
- name: Checkout Mind-Sports-Games/lila-maven
uses: actions/checkout@v4
with:
repository: Mind-Sports-Games/lila-maven
ssh-key: ${{ secrets.MSO_CI_SSH_KEY }}
path: deps/lila-maven
- uses: actions/cache@v4
with:
path: |
~/.sbt
~/.ivy2/cache
key: ${{ runner.os }}-sbt-${{ hashFiles('**/project/build.properties') }}-${{ hashFiles('**/build.sbt') }}-${{ hashFiles('**/project/Dependencies.scala') }}
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17.0.5
- run: TZ=UTC git log -1 --date=iso-strict-local --pretty='format:app.version.commit = "%h"%napp.version.date = "%ad"%napp.version.message = """%s"""%n' | tee conf/version.conf
- run: ./lila -Depoll=true "test;stage"
- run: cp LICENSE COPYING.md README.md target/universal/stage && git log -n 1 --pretty=oneline > target/universal/stage/commit.txt
- run: cd target/universal/stage && tar -cvpJf ../../../lila-3.0.tar.xz . && cd -
env:
XZ_OPT: '-0'
- uses: actions/upload-artifact@v4
if: (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev') && github.event_name == 'push'
with:
name: lila-server
path: lila-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-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 /tmp/lila-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-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 /tmp/lila-3.0.tar.xz
host: ${{ secrets.PSD_MAIN_HOST }}
username: ${{ secrets.PSD_MAIN_USERNAME }}
privateKey: ${{ secrets.MSO_CI_SSH_KEY }}