File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Deploy to Production
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+
8+ jobs :
9+ deploy :
10+ runs-on : ubuntu-latest
11+
12+ steps :
13+ - name : Deploy to Server
14+ 15+ with :
16+ host : ${{ secrets.SERVER_HOST }}
17+ username : ${{ secrets.SERVER_USER }}
18+ key : ${{ secrets.SSH_PRIVATE_KEY }}
19+ script : |
20+ set -e
21+ echo "[$(date)] Starting deployment..."
22+
23+ # Navigate to repository
24+ cd /root/EasyAppDev.Blazor.AutoComplete
25+
26+ # Pull latest changes
27+ echo "[$(date)] Pulling latest changes..."
28+ git pull origin main
29+
30+ # Publish the application
31+ echo "[$(date)] Publishing application..."
32+ /root/.dotnet/dotnet publish samples/AutoComplete.Playground -c Release -o /var/www/blazorautocomplete
33+
34+ # Copy RCL static assets
35+ echo "[$(date)] Copying RCL static assets..."
36+ mkdir -p /var/www/blazorautocomplete/wwwroot/_content/EasyAppDev.Blazor.AutoComplete/styles
37+ cp src/EasyAppDev.Blazor.AutoComplete/wwwroot/styles/*.css /var/www/blazorautocomplete/wwwroot/_content/EasyAppDev.Blazor.AutoComplete/styles/
38+
39+ # Restart the service
40+ echo "[$(date)] Restarting service..."
41+ systemctl restart blazorautocomplete.service
42+
43+ # Wait and verify
44+ sleep 3
45+ if systemctl is-active --quiet blazorautocomplete.service; then
46+ echo "[$(date)] Deployment successful!"
47+ else
48+ echo "[$(date)] ERROR: Service failed to start!"
49+ systemctl status blazorautocomplete.service --no-pager
50+ exit 1
51+ fi
You can’t perform that action at this time.
0 commit comments