34 lines
860 B
YAML
34 lines
860 B
YAML
name: Deploy to Production
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Build Docker image
|
|
run: |
|
|
docker build -t hotelsync-frontend:latest .
|
|
|
|
- name: Deploy frontend
|
|
run: |
|
|
docker stop hotelsync-frontend 2>/dev/null || true
|
|
docker rm hotelsync-frontend 2>/dev/null || true
|
|
docker run -d \
|
|
--name hotelsync-frontend \
|
|
--network hotelsync_hotelsync-net \
|
|
--restart unless-stopped \
|
|
hotelsync-frontend:latest
|
|
echo "✅ Deploy complete!"
|
|
|
|
- name: Health check
|
|
run: |
|
|
sleep 3
|
|
curl -sf http://hotelsync-frontend/ > /dev/null && echo "✅ App is up!" || echo "❌ Health check failed"
|