ci: add Gitea Actions auto-deploy workflow
This commit is contained in:
33
.gitea/workflows/deploy.yml
Normal file
33
.gitea/workflows/deploy.yml
Normal file
@@ -0,0 +1,33 @@
|
||||
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"
|
||||
Reference in New Issue
Block a user