forked from pdinklag/MinecraftStats
-
Notifications
You must be signed in to change notification settings - Fork 1
35 lines (33 loc) · 1.18 KB
/
deploy.yml
File metadata and controls
35 lines (33 loc) · 1.18 KB
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
name: Deploy artifacts
on:
workflow_run:
workflows: [Java CI with Gradle]
types: [completed]
jobs:
deploy:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
permissions:
contents: write
steps:
- uses: robinraju/release-downloader@v1
with:
latest: true
fileName: MinecraftStats*
extract: true
- name: rsync deployment
uses: burnett01/rsync-deployments@7.0.1
with:
switches: -axAXvS --delete --exclude="*config.json" --exclude="data/" --exclude="helper/"
remote_host: host.terrashift.net
remote_path: ${{ secrets.DEPLOY_PATH }}
remote_user: ${{ secrets.DEPLOY_USER }}
remote_key: ${{ secrets.DEPLOY_KEY }}
- name: add key to ssh agent
uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ secrets.DEPLOY_KEY }}
- name: reload stats
run: |
ssh-keyscan -t rsa host.terrashift.net >> ~/.ssh/known_hosts
ssh ${{ secrets.SSH_USER }}@host.terrashift.net "java -jar ${{ secrets.DEPLOY_PATH }}/MinecraftStatsCLI.jar ${{ secrets.DEPLOY_PATH }}/config.json"