diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml new file mode 100644 index 0000000..eea7f98 --- /dev/null +++ b/.gitea/workflows/deploy.yaml @@ -0,0 +1,24 @@ +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