From 2de627ccf70b3389e598e03fc8108153c2d0991a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E6=9C=9D=E4=BC=9F?= Date: Wed, 13 Nov 2024 19:29:09 +0800 Subject: [PATCH] init --- .gitea/workflows/deploy.yaml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .gitea/workflows/deploy.yaml 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