β¨ Improve the bs.hitbox
module (#252)
#39
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: π Deploy on server | |
on: | |
push: | |
branches: [master] | |
workflow_dispatch: | |
inputs: | |
sync: | |
description: "File synchronization" | |
required: true | |
default: "delta" | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Deploy files | |
uses: milanmk/actions-file-deployer@master | |
with: | |
remote-protocol: "sftp" | |
remote-host: ${{ secrets.SFTP_IP }} | |
remote-port: ${{ secrets.SFTP_PORT }} | |
remote-user: ${{ secrets.SFTP_SANDBOX_USER }} | |
remote-password: ${{ secrets.SFTP_PASSWORD }} | |
remote-path: /bookshelf-world/ | |
ftp-mirror-options: "--include-glob=**/*.mca --include-glob=datapacks/** --include-glob=level.dat --include-glob=icon.png" | |
- name: Restart server | |
env: | |
SERVER_RESTART_ENDPOINT: ${{ secrets.SERVER_RESTART_ENDPOINT }} | |
SERVER_RESTART_BEARER: ${{ secrets.SERVER_RESTART_BEARER }} | |
run: | | |
server_full_status=$(curl "$SERVER_RESTART_ENDPOINT/resources" -H 'Accept: application/json' -H 'Content-Type: application/json' -H "Authorization: Bearer $SERVER_RESTART_BEARER" -X GET) | |
server_power_status=$(jq -r '.attributes.current_state' <<<"$server_full_status") | |
if [ $server_power_status = 'running' ]; then | |
echo "Bookshelf's test server is online, restarting it to apply updates" | |
curl "$SERVER_RESTART_ENDPOINT/power" -H 'Accept: application/json' -H 'Content-Type: application/json' -H "Authorization: Bearer $SERVER_RESTART_BEARER" -X POST -d '{"signal": "restart"}' | |
else | |
echo "Bookshelf's test server is offline, it will not be started" | |
fi |