Merge pull request #89 from Mind-Sports-Games/dev #298
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-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 }} |