|
| 1 | +name: Deploy |
| 2 | + |
| 3 | +on: |
| 4 | + check_run: |
| 5 | + types: [requested_action, rerequested] |
| 6 | + |
| 7 | + # Allows you to run this workflow manually from the Actions tab |
| 8 | + workflow_dispatch: |
| 9 | + #on: |
| 10 | + # push: |
| 11 | + # branches: |
| 12 | + # - main |
| 13 | + |
| 14 | +jobs: |
| 15 | + workflow: |
| 16 | + runs-on: ubuntu-latest |
| 17 | + |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@v1 |
| 20 | + |
| 21 | + - name: Upload files |
| 22 | + uses: SamKirkland/FTP-Deploy-Action@2.0.0 |
| 23 | + env: |
| 24 | + FTP_SERVER: ${{ secrets.SFTP_HOST }} |
| 25 | + FTP_USERNAME: ${{ secrets.SFTP_USER }} |
| 26 | + FTP_PASSWORD: ${{ secrets.SFTP_PASS }} |
| 27 | + LOCAL_DIR: ./ |
| 28 | + REMOTE_DIR: ./ |
| 29 | + METHOD: sftp |
| 30 | + PORT: ${{ secrets.SFTP_PORT }} |
| 31 | + ARGS: --no-empty-dirs |
| 32 | + |
| 33 | + - name: Stop the Pterodactyl server |
| 34 | + shell: bash |
| 35 | + run: | |
| 36 | + curl --request POST \ |
| 37 | + --url ${{ secrets.BASE_URL }}api/client/servers/${{ secrets.SERVER_ID }}/power \ |
| 38 | + --header 'Accept: application/json' \ |
| 39 | + --header 'Authorization: Bearer ${{ secrets.API_KEY }}' \ |
| 40 | + --header 'Content-Type: application/json' \ |
| 41 | + --data '{ "signal": "stop" }' |
| 42 | +
|
| 43 | + - name: Kill the Pterodactyl server |
| 44 | + shell: bash |
| 45 | + run: | |
| 46 | + curl --request POST \ |
| 47 | + --url ${{ secrets.BASE_URL }}api/client/servers/${{ secrets.SERVER_ID }}/power \ |
| 48 | + --header 'Accept: application/json' \ |
| 49 | + --header 'Authorization: Bearer ${{ secrets.API_KEY }}' \ |
| 50 | + --header 'Content-Type: application/json' \ |
| 51 | + --data '{ "signal": "kill" }' |
| 52 | +
|
| 53 | + - name: Start the Pterodactyl server |
| 54 | + shell: bash |
| 55 | + run: | |
| 56 | + curl --request POST \ |
| 57 | + --url ${{ secrets.BASE_URL }}api/client/servers/${{ secrets.SERVER_ID }}/power \ |
| 58 | + --header 'Accept: application/json' \ |
| 59 | + --header 'Authorization: Bearer ${{ secrets.API_KEY }}' \ |
| 60 | + --header 'Content-Type: application/json' \ |
| 61 | + --data '{ "signal": "start" }' |
0 commit comments