web-api/.gitea/workflows/deploy.yaml
梁朝伟 2de627ccf7
All checks were successful
Deploy to Production / deploy (push) Successful in 15s
init
2024-11-13 19:29:09 +08:00

25 lines
752 B
YAML

name: Deploy to Production
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: appleboy-ssh-action
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.PROD_HOST }}
port: ${{ secrets.PROD_PORT }}
username: ${{ secrets.PROD_USER }}
key: ${{ secrets.PROD_KEY }}
script: |
cd /data/www/bydauto/web-api
sudo -Hu www-data git pull origin main
sudo -Hu www-data composer install
sudo -Hu www-data /usr/local/bin/composer dump-autoload
sudo -Hu www-data php artisan optimize:clear
sudo -Hu www-data php artisan optimize
/usr/bin/supervisorctl reload