refactor: update deployment process to use SSH and clone repository
All checks were successful
Deploy Website / deploy (push) Successful in 3s

This commit is contained in:
Roberto Musso
2026-04-11 17:48:42 +02:00
parent ec5284457f
commit 64d9f35f27

View File

@@ -10,27 +10,35 @@ jobs:
deploy: deploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout Repository - name: Deploy via SSH
uses: actions/checkout@v4
- name: Deploy static files via SCP
uses: appleboy/scp-action@v0.1.7
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_KEY }}
source: "index.html,privacy.html,terms.html,assets/*"
target: "/opt/adiuvai-waitlist/website/"
rm: true
- name: Verify deployment
uses: appleboy/ssh-action@v1.0.0 uses: appleboy/ssh-action@v1.0.0
with: with:
host: ${{ secrets.SSH_HOST }} host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }} username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_KEY }} key: ${{ secrets.SSH_KEY }}
script: | script: |
if [ -f /opt/adiuvai-waitlist/website/index.html ]; then set -e
DEPLOY_DIR="/opt/adiuvai-waitlist/website"
REPO_URL="https://git.muticolturano.com/${{ gitea.repository }}.git"
# Clone latest into temp dir
cd /tmp && rm -rf website-deploy
git clone --depth 1 "${REPO_URL}" website-deploy
# Sync files (clear contents, not the directory itself)
mkdir -p "$DEPLOY_DIR"
find "$DEPLOY_DIR" -mindepth 1 -delete
cp -r /tmp/website-deploy/index.html \
/tmp/website-deploy/privacy.html \
/tmp/website-deploy/terms.html \
"$DEPLOY_DIR/"
[ -d /tmp/website-deploy/assets ] && cp -r /tmp/website-deploy/assets "$DEPLOY_DIR/"
# Cleanup
rm -rf /tmp/website-deploy
# Verify
if [ -f "$DEPLOY_DIR/index.html" ]; then
echo "✅ Website deployed" echo "✅ Website deployed"
else else
echo "❌ index.html not found" echo "❌ index.html not found"