GOOD SHELL MAS BOY
Server: Apache/2.4.52 (Ubuntu)
System: Linux vmi1836763.contaboserver.net 5.15.0-130-generic #140-Ubuntu SMP Wed Dec 18 17:59:53 UTC 2024 x86_64
User: www-data (33)
PHP: 8.4.10
Disabled: NONE
Upload Files
File: /var/www/staging.fixgini.com/.github/workflows/staging-deploy.yml
name: Staging Deployment

on:
  push:
    branches:
      - staging # Trigger when pushing to the staging branch

jobs:
  deploy:
    runs-on: ubuntu-latest

    steps:
    - name: Checkout code
      uses: actions/checkout@v2

    - name: Set up PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: '8.2'

    - name: Install dependencies
      run: |
        composer install
        npm install
        npm run build

    - name: Set up SSH
      run: |
        mkdir -p ~/.ssh
        ssh-keyscan -H ${{ secrets.STAGING_SERVER_IP }} >> ~/.ssh/known_hosts
        chmod 700 ~/.ssh
        chmod 644 ~/.ssh/known_hosts
        echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
        chmod 600 ~/.ssh/id_rsa

    - name: Deploy to Staging
      run: |
        ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no root@${{ secrets.STAGING_SERVER_IP }} 'cd /var/www/staging.fixgini.com && git pull origin staging && php artisan migrate'