Files
Ressources-relationnel/.github/workflows/deploy.yml
T
Sam Depardieu e82ec21300 Add GitHub Actions workflow for Laravel deployment
This workflow automates the deployment of a Laravel application to a server via SSH when changes are pushed to the main branch.
2026-03-25 22:41:27 +01:00

24 lines
720 B
YAML

name: Deploy Laravel App
on:
push:
branches: [ main ] # Déclenche le déploiement lors d'un push sur la branche main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Deploy to Server via SSH
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd /home/sam/mon-app-laravel
git pull origin main
docker-compose up -d --build
docker exec laravel_app php artisan migrate --force
docker exec laravel_app php artisan config:cache
docker exec laravel_app php artisan route:cache