```
✨ feat(maintenance): Ajoute une page et un mode maintenance activable.
```
This commit is contained in:
@@ -1,34 +1,25 @@
|
||||
# Nom du workflow
|
||||
name: Symfony CI - Install, Test, Build, Attest & Deploy
|
||||
deploy:
|
||||
name: 🚀 Deploy to Production
|
||||
runs-on: ubuntu-latest # N'oublie pas de préciser l'OS du runner
|
||||
steps:
|
||||
- name: Deploy with SSH
|
||||
uses: appleboy/ssh-action@v1.0.0
|
||||
with:
|
||||
host: ${{ secrets.SSH_HOST }}
|
||||
username: ${{ secrets.SSH_USER }}
|
||||
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||
port: 22
|
||||
script: |
|
||||
cd /var/www/ludikevent-intranet
|
||||
|
||||
# Déclencheurs du workflow
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master # Ou 'main'
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
branches:
|
||||
- master # Ou 'main'
|
||||
# 1. Activer la maintenance
|
||||
php bin/console app:maintenance on
|
||||
|
||||
# Permissions nécessaires pour les actions utilisées
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
id-token: write
|
||||
attestations: write
|
||||
security-events: write # Requis pour Snyk pour poster les résultats
|
||||
# 2. Mise à jour du code
|
||||
git pull
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
name: 🚀 Deploy to Production
|
||||
steps:
|
||||
- name: Deploy with SSH & Ansible
|
||||
uses: appleboy/ssh-action@v1.0.0
|
||||
with:
|
||||
host: ${{ secrets.SSH_HOST }}
|
||||
username: ${{ secrets.SSH_USER }}
|
||||
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||
port: 22
|
||||
script: |
|
||||
cd /var/www/ludikevent-intranet && git pull && nohup sh ./update.sh
|
||||
# 3. Exécuter ton script d'update (migrations, install, etc.)
|
||||
sh ./update.sh
|
||||
|
||||
# 4. Désactiver la maintenance
|
||||
php bin/console app:maintenance off
|
||||
|
||||
Reference in New Issue
Block a user