Add AI debug shit to help me fix this shit

This commit is contained in:
2025-10-30 22:11:32 +00:00
parent f178e718d7
commit b7083e5b42

View File

@@ -3,7 +3,7 @@ name: Deploy Website
on: on:
push: push:
branches: branches:
- main # change if your main branch is different - main # change if your main branch is different
jobs: jobs:
deploy: deploy:
@@ -12,41 +12,48 @@ jobs:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v3
# Debug step (optional) # ---- Debug info ----
- name: Debug environment - name: Debug secrets and env
run: | run: |
echo "Host: ${DEPLOY_HOST}" echo "Host: ${DEPLOY_HOST}"
echo "User: ${DEPLOY_USER}" echo "User: ${DEPLOY_USER}"
echo "Port: ${DEPLOY_PORT:-22}" echo "Port: ${DEPLOY_PORT:-22}"
if [ -n "${DEPLOY_KEY}" ]; then if [ -n "${DEPLOY_KEY}" ]; then
echo "✅ DEPLOY_KEY is set" echo "✅ DEPLOY_KEY appears set (length: ${#DEPLOY_KEY})"
else else
echo "❌ DEPLOY_KEY is missing!" echo "❌ DEPLOY_KEY is empty!"
exit 1
fi fi
env: env:
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }} DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
DEPLOY_USER: ${{ secrets.DEPLOY_USER }} DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
DEPLOY_PORT: ${{ secrets.DEPLOY_PORT }} DEPLOY_PORT: ${{ secrets.DEPLOY_PORT }}
# Set up SSH key safely # ---- SSH setup ----
- name: Set up SSH key - name: Set up SSH key
run: | run: |
set -e set -e
mkdir -p ~/.ssh mkdir -p ~/.ssh
chmod 700 ~/.ssh
printf "%s" "${DEPLOY_KEY}" > ~/.ssh/id_rsa printf "%s" "${DEPLOY_KEY}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa chmod 600 ~/.ssh/id_rsa
ssh-keyscan -p "${DEPLOY_PORT:-22}" -H "${DEPLOY_HOST}" >> ~/.ssh/known_hosts
echo "🔑 Testing ssh-keyscan on ${DEPLOY_HOST}:${DEPLOY_PORT:-22}"
if ! ssh-keyscan -p "${DEPLOY_PORT:-22}" -H "${DEPLOY_HOST}" >> ~/.ssh/known_hosts 2>/dev/null; then
echo "⚠️ ssh-keyscan failed (host unreachable?)"
fi
env: env:
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }} DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
DEPLOY_PORT: ${{ secrets.DEPLOY_PORT }} DEPLOY_PORT: ${{ secrets.DEPLOY_PORT }}
# Deploy site files with rsync over custom port # ---- Deploy via rsync ----
- name: Deploy website via rsync - name: Deploy website via rsync
run: | run: |
echo "🚀 Deploying files to ${DEPLOY_USER}@${DEPLOY_HOST}:${DEPLOY_PATH} (port ${DEPLOY_PORT:-22})" echo "🚀 Deploying to ${DEPLOY_USER}@${DEPLOY_HOST}:${DEPLOY_PATH} (port ${DEPLOY_PORT:-22})"
rsync -avz -e "ssh -p ${DEPLOY_PORT:-22}" --delete ./ ${DEPLOY_USER}@${DEPLOY_HOST}:${DEPLOY_PATH} rsync -avz -e "ssh -p ${DEPLOY_PORT:-22}" --delete ./ \
${DEPLOY_USER}@${DEPLOY_HOST}:${DEPLOY_PATH}
env: env:
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }} DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
DEPLOY_USER: ${{ secrets.DEPLOY_USER }} DEPLOY_USER: ${{ secrets.DEPLOY_USER }}