From e82ec21300ee200bff9ca0373fd39595442a4a0a Mon Sep 17 00:00:00 2001 From: Sam Depardieu <67928571+Sam-Depardieu@users.noreply.github.com> Date: Wed, 25 Mar 2026 22:41:27 +0100 Subject: [PATCH] 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. --- .github/workflows/deploy.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..02dfb8c --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,23 @@ +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