# Tạm tắt: chưa triển khai CI/CD. Bỏ comment toàn bộ file để bật lại. # name: Deploy Portal API # # on: # push: # branches: # - production # workflow_dispatch: # # jobs: # deploy: # runs-on: ubuntu-latest # # steps: # - name: Deploy # uses: appleboy/ssh-action # with: # host: ${{ secrets.HOST }} # username: ${{ secrets.USERNAME }} # key: ${{ secrets.SSH_PRIVATE_KEY }} # port: ${{ secrets.PORT }} # script_stop: true # # script: | # set -e # # cd ~/httpdocs # # echo "==> Pulling latest code..." # git fetch origin production # git reset --hard origin/production # # echo "==> Installing dependencies..." # composer install --no-dev --no-interaction --prefer-dist --optimize-autoloader # # echo "==> Running migrations..." # php artisan migrate --force # # echo "==> Optimizing Laravel..." # php artisan optimize # # echo "==> Restarting queue workers..." # php artisan queue:restart # # echo "==> Deploy completed!"