Ajout de mise a jour auto serv encore encore cnore enceojh
This commit is contained in:
parent
cf4a4e4056
commit
0065d789e3
1 changed files with 17 additions and 12 deletions
29
.github/workflows/deploy.yml
vendored
29
.github/workflows/deploy.yml
vendored
|
|
@ -13,10 +13,10 @@ jobs:
|
|||
- name: Deploy via SSH
|
||||
uses: appleboy/ssh-action@v1.0.0
|
||||
with:
|
||||
host: boulayoune.com # ton serveur
|
||||
username: yass # ton utilisateur SSH
|
||||
key: ${{ secrets.SSH_KEY }} # clé privée SSH sécurisée
|
||||
port: 22 # port SSH (par défaut 22)
|
||||
host: boulayoune.com
|
||||
username: yass
|
||||
key: ${{ secrets.SSH_KEY }}
|
||||
port: 22
|
||||
script: |
|
||||
set -e
|
||||
|
||||
|
|
@ -26,14 +26,19 @@ jobs:
|
|||
cd /var/www/projet_php
|
||||
|
||||
echo "➡️ Mise à jour depuis GitHub"
|
||||
git fetch origin main
|
||||
git reset --hard origin/main
|
||||
# On force le nettoyage pour éviter les conflits de fichiers locaux
|
||||
sudo git fetch origin main
|
||||
sudo git reset --hard origin/main
|
||||
|
||||
echo "➡️ Correction des permissions Smarty"
|
||||
chown -R yass:www-data /var/www/projet_php
|
||||
chmod -R 775 /var/www/projet_php/templates_c
|
||||
echo "➡️ Correction des permissions et nettoyage"
|
||||
# Utilisation de sudo pour les tâches root
|
||||
sudo chown -R yass:www-data /var/www/projet_php
|
||||
|
||||
echo "➡️ Nettoyage du cache Smarty"
|
||||
rm -rf /var/www/projet_php/templates_c/*
|
||||
# On s'assure que le dossier templates_c existe avant le chmod
|
||||
mkdir -p /var/www/projet_php/templates_c
|
||||
sudo chmod -R 775 /var/www/projet_php/templates_c
|
||||
|
||||
echo "✅ Déploiement terminé"
|
||||
echo "➡️ Vidage du cache Smarty"
|
||||
sudo rm -rf /var/www/projet_php/templates_c/*
|
||||
|
||||
echo "✅ Déploiement terminé avec succès !"
|
||||
Loading…
Add table
Add a link
Reference in a new issue