Dev -> Master Use SG 174 #462
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-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: 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: 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@v4 | |
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 }} |