feat: Ajout workflows de déploiement automatique

- Ajout workflow de déploiement sur Render
- Ajout workflow de déploiement sur serveur Linux
- Configuration pour déploiement automatique avec tags
- Prêt pour déploiement en production
This commit is contained in:
Rassaby Ludovic
2025-10-16 13:23:51 +04:00
parent b8d075a2bd
commit 37199521e4
3 changed files with 89 additions and 1 deletions
+31
View File
@@ -0,0 +1,31 @@
name: 🚀 Deploy to Render
on:
push:
tags: [ 'v*' ]
workflow_dispatch:
env:
RENDER_SERVICE_ID: ${{ secrets.RENDER_SERVICE_ID }}
RENDER_API_KEY: ${{ secrets.RENDER_API_KEY }}
jobs:
deploy:
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
steps:
- name: 📥 Checkout repository
uses: actions/checkout@v4
- name: 🚀 Deploy to Render
uses: johnbeynon/render-deploy-action@v0.0.8
with:
service-id: ${{ env.RENDER_SERVICE_ID }}
api-key: ${{ env.RENDER_API_KEY }}
wait-for-success: true
- name: ✅ Deployment successful
run: |
echo "🎉 Application deployed successfully to Render!"
echo "🌐 Your app is now accessible publicly"
+57
View File
@@ -0,0 +1,57 @@
name: 🚀 Deploy to Linux Server
on:
push:
tags: [ 'v*' ]
workflow_dispatch:
env:
SERVER_HOST: ${{ secrets.SERVER_HOST }}
SERVER_USER: ${{ secrets.SERVER_USER }}
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
jobs:
deploy:
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
steps:
- name: 📥 Checkout repository
uses: actions/checkout@v4
- name: 🔐 Setup SSH
uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: ${{ env.SSH_PRIVATE_KEY }}
- name: 🚀 Deploy to server
run: |
ssh -o StrictHostKeyChecking=no ${{ env.SERVER_USER }}@${{ env.SERVER_HOST }} << 'EOF'
# Navigate to project directory
cd /opt/dockezr
# Pull latest changes
git fetch origin
git checkout ${{ github.ref_name }}
# Pull latest images
docker-compose pull
# Restart services
docker-compose down
docker-compose up -d
# Wait for services to be ready
sleep 30
# Test connectivity
curl -f http://localhost:3000/health || exit 1
curl -f http://localhost:8001/health || exit 1
echo "🎉 Deployment successful!"
EOF
- name: ✅ Deployment successful
run: |
echo "🎉 Application deployed successfully to server!"
echo "🌐 Your app is now accessible at: http://${{ env.SERVER_HOST }}"
+1 -1
View File
@@ -9,7 +9,7 @@ on:
env: env:
REGISTRY: docker.io REGISTRY: docker.io
IMAGE_NAME: ${{ github.repository }} IMAGE_NAME: lasdecoeurdocker/dockezr
jobs: jobs:
build-and-push: build-and-push: