60
.gitea/workflows/deploy.yml
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
name: Deploy to Production
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Deploy to server
|
||||||
|
run: |
|
||||||
|
echo "🚀 Deploying to /var/www/html/games"
|
||||||
|
echo "📁 Current directory: $(pwd)"
|
||||||
|
echo "📁 GITHUB_WORKSPACE: $GITHUB_WORKSPACE"
|
||||||
|
|
||||||
|
# Create base directory
|
||||||
|
mkdir -p /var/www/html/games/
|
||||||
|
|
||||||
|
# Find and deploy all game folders (exclude source, .git, .gitea, etc.)
|
||||||
|
DEPLOYED_FOLDERS=""
|
||||||
|
DEPLOYED_URLS=""
|
||||||
|
for folder in $GITHUB_WORKSPACE/*/; do
|
||||||
|
folder_name=$(basename "$folder")
|
||||||
|
|
||||||
|
# Skip excluded folders
|
||||||
|
if [[ "$folder_name" == "source" ]] || \
|
||||||
|
[[ "$folder_name" == ".git" ]] || \
|
||||||
|
[[ "$folder_name" == ".gitea" ]] || \
|
||||||
|
[[ "$folder_name" == "node_modules" ]] || \
|
||||||
|
[[ "$folder_name" == "logs" ]] || \
|
||||||
|
[[ "$folder_name" == "uploads" ]]; then
|
||||||
|
echo "⏭️ Skipping: $folder_name"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Deploy the folder
|
||||||
|
echo "📦 Deploying: $folder_name"
|
||||||
|
rsync -av --delete "$folder" "/var/www/html/games/$folder_name/"
|
||||||
|
DEPLOYED_FOLDERS="$DEPLOYED_FOLDERS $folder_name"
|
||||||
|
DEPLOYED_URLS="$DEPLOYED_URLS\n 🔗 https://senaai.tech/games/$folder_name/"
|
||||||
|
done
|
||||||
|
|
||||||
|
# Clear console and show only deployment summary
|
||||||
|
clear
|
||||||
|
echo ""
|
||||||
|
echo "=========================================="
|
||||||
|
echo "🎉 Deployment Completed Successfully!"
|
||||||
|
echo "=========================================="
|
||||||
|
echo ""
|
||||||
|
echo "📍 Deployed URLs:"
|
||||||
|
echo -e "$DEPLOYED_URLS"
|
||||||
|
echo ""
|
||||||
|
echo "=========================================="
|
||||||
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 96 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 168 B After Width: | Height: | Size: 168 B |
|
Before Width: | Height: | Size: 129 KiB After Width: | Height: | Size: 129 KiB |
|
Before Width: | Height: | Size: 169 KiB After Width: | Height: | Size: 169 KiB |
|
Before Width: | Height: | Size: 2.5 MiB After Width: | Height: | Size: 2.5 MiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 158 KiB After Width: | Height: | Size: 158 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 162 KiB After Width: | Height: | Size: 162 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 73 KiB |
|
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 9.2 KiB |