From 7fab9439567e4ba73ae15ab2cce5d104b6ee6952 Mon Sep 17 00:00:00 2001 From: pbao9 Date: Wed, 18 Mar 2026 09:24:01 +0700 Subject: [PATCH] update docker --- .github/workflows/deploy.yml | 44 ++++++++---------------------------- 1 file changed, 9 insertions(+), 35 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 206f554..3200eff 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,4 +1,4 @@ -name: Deploy to Server +name: Deploy Portal API on: push: @@ -8,14 +8,7 @@ on: jobs: deploy: runs-on: ubuntu-latest - steps: - - name: Debug secrets - run: | - echo "HOST=${{ secrets.HOST }}" - echo "PORT=${{ secrets.PORT }}" - echo "USER=${{ secrets.USERNAME }}" - - name: Deploy to server uses: appleboy/ssh-action@v1.0.3 with: @@ -23,15 +16,9 @@ jobs: username: ${{ secrets.USERNAME }} key: ${{ secrets.SSH_KEY }} port: ${{ secrets.PORT }} - debug: true script_stop: true script: | set -e - set -x - - echo "๐Ÿš€ Connected to server" - whoami - pwd echo "๐Ÿ“ Go to project path" cd ${{ secrets.PROJECT_PATH }} @@ -39,26 +26,13 @@ jobs: echo "๐Ÿ”„ Pulling latest code..." git pull origin develop - echo "๐Ÿ“ฆ Installing Composer dependencies..." - composer install --no-dev --optimize-autoloader + echo "๐Ÿณ Rebuilding Docker container..." + docker compose up -d --build --remove-orphans portal - echo "๐Ÿ“ฆ Installing NPM dependencies..." - npm ci + echo "โšก Running Laravel optimizations..." + docker compose exec -T portal php artisan migrate --force + docker compose exec -T portal php artisan config:cache + docker compose exec -T portal php artisan route:cache + docker compose exec -T portal php artisan optimize - echo "๐Ÿ—๏ธ Building assets..." - npm run build - - echo "โšก Optimizing Laravel..." - php artisan config:cache - php artisan route:cache - php artisan view:cache - php artisan optimize - - echo "๐Ÿงน Clearing application cache..." - php artisan cache:clear - - echo "๐Ÿ” Setting permissions..." - chmod -R 775 storage bootstrap/cache - chown -R www-data:www-data storage bootstrap/cache - - echo "โœ… Deployment completed successfully!" \ No newline at end of file + echo "โœ… Deployment completed!" \ No newline at end of file