feat: Add project detail page with animated hero section, dynamic gal… #13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy to Hostgator (Production) | |
| on: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| build-and-deploy: | |
| name: Build & Deploy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install & Build Assets | |
| run: | | |
| npm ci | |
| npm run build | |
| - name: Upload Built Assets to Hostgator | |
| uses: appleboy/scp-action@master | |
| with: | |
| host: ${{ secrets.SSH_HOST }} | |
| username: ${{ secrets.SSH_USERNAME }} | |
| key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| port: 2222 | |
| source: "public/build" | |
| target: ${{ secrets.PROJECT_PATH }} | |
| - name: Deploy Backend via SSH | |
| uses: appleboy/ssh-action@master | |
| with: | |
| host: ${{ secrets.SSH_HOST }} | |
| username: ${{ secrets.SSH_USERNAME }} | |
| key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| port: 2222 | |
| script: | | |
| set -e | |
| # --- CONFIGURACIÓN DE RUTAS --- | |
| # Tu PHP 8.3 real | |
| PHP_BIN="/opt/cpanel/ea-php83/root/usr/bin/php" | |
| # La ruta de Composer que encontraste | |
| COMPOSER_BIN="/opt/cpanel/composer/bin/composer" | |
| echo "🚀 Iniciando despliegue usando PHP 8.3 y Composer de sistema..." | |
| cd ${{ secrets.PROJECT_PATH }} | |
| # 1. Poner en mantenimiento | |
| $PHP_BIN artisan down || true | |
| # 2. Descartar cambios locales y descargar código | |
| git reset --hard HEAD | |
| git pull origin master | |
| # 3. Instalar dependencias | |
| # Usamos $PHP_BIN delante de $COMPOSER_BIN para asegurar que Composer | |
| # se ejecute con la versión 8.3 y no con la del sistema por defecto. | |
| export COMPOSER_ALLOW_SUPERUSER=1 | |
| $PHP_BIN $COMPOSER_BIN install --no-interaction --prefer-dist --optimize-autoloader --no-dev | |
| # 4. Migraciones y Limpieza | |
| $PHP_BIN artisan migrate --force | |
| echo "🧹 Limpiando cachés..." | |
| $PHP_BIN artisan optimize:clear | |
| $PHP_BIN artisan config:cache | |
| $PHP_BIN artisan event:cache | |
| $PHP_BIN artisan route:cache | |
| $PHP_BIN artisan view:cache | |
| # Generar Sitemap | |
| echo "🗺️ Generando sitemap..." | |
| $PHP_BIN artisan sitemap:generate | |
| # 5. Levantar el sitio | |
| $PHP_BIN artisan up | |
| echo "✅ ¡Despliegue Exitoso!" |