Skip to content

Commit

Permalink
Add upload
Browse files Browse the repository at this point in the history
  • Loading branch information
29cmb committed Nov 29, 2024
1 parent c2da0f8 commit e41e28c
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/upload.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
on:
workflow_dispatch:
inputs:
resource_pack_url:
description: 'Resource Pack URL'
required: true
default: ''
resource_pack_hash:
description: 'Resource Pack Hash'
required: true
default: ''

jobs:
upload:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install SSH client and sshpass
run: sudo apt-get update && sudo apt-get install -y openssh-client sshpass

- name: SSH into server and update server.properties
env:
SSH_USERNAME: ${{ secrets.SSH_USERNAME }}
SSH_DOMAIN: ${{ secrets.SSH_DOMAIN }}
SSH_PORT: ${{ secrets.SSH_PORT }}
SSH_PASSWORD: ${{ secrets.SSH_PASSWORD }}
RESOURCE_PACK_URL: ${{ github.event.inputs.resource_pack_url }}
RESOURCE_PACK_HASH: ${{ github.event.inputs.resource_pack_hash }}
run: |
sshpass -p $SSH_PASSWORD ssh -o StrictHostKeyChecking=no $SSH_USERNAME@$SSH_DOMAIN -p $SSH_PORT << 'EOF'
sed -i 's|^resource-pack=.*|resource-pack=${RESOURCE_PACK_URL}|' server.properties
sed -i 's|^resource-pack-sha1=.*|resource-pack-sha1=${RESOURCE_PACK_HASH}|' server.properties
exit
EOF

0 comments on commit e41e28c

Please sign in to comment.