This commit is contained in:
Michał Zieliński
2025-09-13 21:42:57 +02:00
parent 8ef949d0fc
commit 8dc8f11f56

View File

@@ -62,4 +62,41 @@ jobs:
echo "::endgroup::"
echo "::group::webapi"
ls -laR artifacts/webapi || true
echo "::endgroup::"
echo "::endgroup::"
# 3) Package artifacts as ZIPs for transfer
- name: Package artifacts as ZIPs
run: |
mkdir -p build
(cd artifacts/frontend && zip -rq ../../build/DiunaBI-Morska-Frontend.zip .)
(cd artifacts/webapi && zip -rq ../../build/DiunaBI-Morska-WebApi.zip .)
ls -la build
# 4) Upload ZIPs to remote server via SSH (using secret key)
- name: Upload artifacts to remote server
env:
SSH_PRIVATE_KEY: ${{ secrets.BIMIT_SSH_KEY }}
SSH_USER: mz
SSH_HOST: bim-it.pl
REMOTE_DIR: deployment
run: |
set -euo pipefail
# Prepare key
umask 077
echo "$SSH_PRIVATE_KEY" > private_key
chmod 600 private_key
# Preload known_hosts (safer than StrictHostKeyChecking=no)
mkdir -p ~/.ssh
ssh-keyscan -H "$SSH_HOST" >> ~/.ssh/known_hosts
# Ensure remote dir exists
ssh -i private_key "$SSH_USER@$SSH_HOST" "mkdir -p ~/$REMOTE_DIR"
# Upload files
scp -i private_key build/DiunaBI-Morska-Frontend.zip "$SSH_USER@$SSH_HOST:~/$REMOTE_DIR/"
scp -i private_key build/DiunaBI-Morska-WebApi.zip "$SSH_USER@$SSH_HOST:~/$REMOTE_DIR/"
# Cleanup
shred -u private_key