Skip to content

Deploy artifacts

Deploy artifacts #32

Workflow file for this run

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/[email protected]
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/[email protected]
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"