Autozip v2.1 (lol)

This commit is contained in:
Evorp
2025-12-17 16:52:34 -08:00
parent ed32bdbd2a
commit bd075f63a0

View File

@@ -1,24 +1,23 @@
name: Autozip Pack name: Autozip Pack
on: on:
push: push:
branches-ignore: branches-ignore: [ main, master ]
- main workflow_dispatch:
- master
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
# Set up the ssh agent (easier & faster than creating folders, config, and authorized_keys) # Sets up SSH agent (easier than creating folders, config, and authorized_keys)
- uses: webfactory/ssh-agent@v0.9.0 - name: Set up SSH authentication
uses: webfactory/ssh-agent@v0.9.0
with: with:
ssh-private-key: ${{ secrets.VPS_SSH_KEY }} ssh-private-key: ${{ secrets.VPS_SSH_KEY }}
# Saves the branch files on the runner # Fetches the branch files on the runner
- name: Get deployed branch - name: Get updated branch
uses: actions/checkout@v6 uses: actions/checkout@v6
with:
fetch-depth: 0
# 1 - zips the pack # 1 - zips the pack
# 2 - creates subdirectories (rsync doesn't always do that) # 2 - creates subdirectories (rsync doesn't always do that)
@@ -28,9 +27,10 @@ jobs:
echo "Creating resource pack zip..." echo "Creating resource pack zip..."
ZIP_NAME=$(echo "${{ vars.ZIP_NAME_TEMPLATE }}" | sed "s|%VERSION%|${{ github.ref_name }}|") ZIP_NAME=$(echo "${{ vars.ZIP_NAME_TEMPLATE }}" | sed "s|%VERSION%|${{ github.ref_name }}|")
FINAL_LOCATION="${{ vars.ZIP_PATH }}/${ZIP_NAME}.zip" ZIP_FILENAME=${ZIP_NAME}.${{ vars.ZIP_EXTENSION }}
FINAL_LOCATION="${{ vars.ZIP_PATH }}/${ZIP_FILENAME}"
zip -r "${ZIP_NAME}.zip" . -x ".*" -x "*/.*" zip -r "${ZIP_FILENAME}" . -x ".*" -x "*/.*"
echo "Creating directory ${{ vars.ZIP_PATH }} on server..." echo "Creating directory ${{ vars.ZIP_PATH }} on server..."
@@ -44,7 +44,7 @@ jobs:
rsync -havzP \ rsync -havzP \
-e "ssh -p ${{ secrets.VPS_SSH_PORT }} -o StrictHostKeyChecking=no" \ -e "ssh -p ${{ secrets.VPS_SSH_PORT }} -o StrictHostKeyChecking=no" \
"${ZIP_NAME}.zip" \ "${ZIP_FILENAME}" \
"${SSH_ADDRESS}:${FINAL_LOCATION}" "${SSH_ADDRESS}:${FINAL_LOCATION}"
echo "File uploaded to $FINAL_LOCATION" echo "File uploaded to $FINAL_LOCATION"