From 4d7c3a5f75be79d9073786ff62695a606d84dca7 Mon Sep 17 00:00:00 2001 From: Vaibhav Rathore Date: Sat, 24 Jan 2026 19:51:27 +0530 Subject: [PATCH 1/4] prod deployment building assets on ci --- .github/workflows/production-deployment.yml | 61 +++++++++++++++------ 1 file changed, 45 insertions(+), 16 deletions(-) diff --git a/.github/workflows/production-deployment.yml b/.github/workflows/production-deployment.yml index de69a64..7250ef6 100644 --- a/.github/workflows/production-deployment.yml +++ b/.github/workflows/production-deployment.yml @@ -1,20 +1,48 @@ name: Production Deployment + on: push: - branches: [main] + branches: [main, feature/prod-deployment] jobs: - build: - name: build + deploy: runs-on: ubuntu-latest - # uses GitHub environment environment: name: Production steps: + # 1️⃣ Checkout code - uses: actions/checkout@v3 - - name: Deploy to production + + # 2️⃣ Setup Node (for Vite build) + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + + # 3️⃣ Install frontend deps + - name: Install frontend dependencies + run: npm ci + + # 4️⃣ Build frontend assets + - name: Build frontend assets + run: npm run build + + # 5️⃣ Rsync build output to server + - name: Upload built assets to server + uses: appleboy/scp-action@master + with: + host: ${{ secrets.SSH_HOST }} + username: ${{ secrets.SSH_USERNAME }} + key: ${{ secrets.SSH_PRIVATE_KEY }} + source: "public/build" + target: ${{ secrets.SSH_BUILD_DIRECTORY }}/public + strip_components: 1 + + # 6️⃣ Deploy backend on server + - name: Deploy backend to production uses: appleboy/ssh-action@master env: SSH_BUILD_DIRECTORY: ${{ secrets.SSH_BUILD_DIRECTORY }} @@ -29,20 +57,21 @@ jobs: echo "Enabling maintenance mode" php artisan down - echo "Pulling latest code" - git checkout -f main - git pull origin main - php artisan migrate --force + echo "Pulling latest backend code" + git checkout -f feature/prod-deployment + git pull origin feature/prod-deployment - echo "Running composer" - composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --optimize-autoloader --no-dev - composer dump-autoload + echo "Running migrations" + php artisan migrate --force - echo "Building frontend assets" - npm install - npm run build + echo "Installing composer dependencies" + composer install \ + --no-dev \ + --prefer-dist \ + --no-interaction \ + --optimize-autoloader - echo "Optimizing Laravel app" + echo "Optimizing Laravel" php artisan optimize:clear echo "Disabling maintenance mode" From e97a39f1747f1ad3b0cae36adfaa898a3facc9d7 Mon Sep 17 00:00:00 2001 From: Vaibhav Rathore Date: Sat, 24 Jan 2026 19:57:28 +0530 Subject: [PATCH 2/4] node version updated --- .github/workflows/production-deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/production-deployment.yml b/.github/workflows/production-deployment.yml index 7250ef6..e18e8fe 100644 --- a/.github/workflows/production-deployment.yml +++ b/.github/workflows/production-deployment.yml @@ -19,7 +19,7 @@ jobs: - name: Setup Node uses: actions/setup-node@v4 with: - node-version: 20 + node-version: 24 cache: npm # 3️⃣ Install frontend deps From 6b51044239b54d7b45ec76c32fd9b895d4093b44 Mon Sep 17 00:00:00 2001 From: Vaibhav Rathore Date: Sat, 24 Jan 2026 19:57:56 +0530 Subject: [PATCH 3/4] switched to main branch --- .github/workflows/production-deployment.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/production-deployment.yml b/.github/workflows/production-deployment.yml index e18e8fe..9d4ced1 100644 --- a/.github/workflows/production-deployment.yml +++ b/.github/workflows/production-deployment.yml @@ -2,7 +2,7 @@ name: Production Deployment on: push: - branches: [main, feature/prod-deployment] + branches: [main] jobs: deploy: @@ -58,8 +58,8 @@ jobs: php artisan down echo "Pulling latest backend code" - git checkout -f feature/prod-deployment - git pull origin feature/prod-deployment + git checkout -f main + git pull origin main echo "Running migrations" php artisan migrate --force From ce37d815be3f084ae34cbac07367ed5391631825 Mon Sep 17 00:00:00 2001 From: Vaibhav Rathore Date: Sat, 24 Jan 2026 20:06:29 +0530 Subject: [PATCH 4/4] lint yml updated --- .github/workflows/lint.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index be97a68..8bde913 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -8,7 +8,7 @@ jobs: strategy: fail-fast: true matrix: - php: [8.1] + php: [8.3] steps: - name: Checkout code @@ -18,7 +18,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - extensions: json, dom, curl, libxml, mbstring + extensions: json, dom, curl, libxml, mbstring, pdo, pdo_mysql, intl, zip, bcmath, sodium coverage: none - name: Install Pint