From 1120df491b513b3c7ce7418c9edfef47669bac85 Mon Sep 17 00:00:00 2001 From: Dhaverd Date: Fri, 28 Mar 2025 06:29:15 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20.gitea/workflows/action.yaml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/action.yaml | 52 +++++++++++++++++++++++++++++++----- 1 file changed, 46 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/action.yaml b/.gitea/workflows/action.yaml index 444d18a..4b11154 100644 --- a/.gitea/workflows/action.yaml +++ b/.gitea/workflows/action.yaml @@ -1,9 +1,49 @@ -name: Gitea Actions Demo -run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 -on: [push] -runs-on: [linux_amd64] +name: Deploy Wishlist +on: + push: + branches: [ main ] jobs: - health-chek: + deploy: + runs-on: ubuntu steps: - - run: echo "Hello World!" \ No newline at end of file + - name: Checkout code + uses: actions/checkout@v3 + + - name: Create .env file from secrets + run: cat ${ENV_PROD} > .env + + - name: Install PHP dependencies + run: composer install + + - name: Install Node.js dependencies + run: npm i + + - name: Build assets + run: npm run build + + - name: Copy files to deployment directory + run: | + rsync -av ./ ${DEPLOY_DIR}/ + + if [ -f .env ]; then + cp .env ${DEPLOY_DIR}/.env + fi + + sudo chmod -R 777 ${DEPLOY_DIR} + + #- name: Run migrations + # run: php artisan migrate --force + + #- name: Clear cache + # run: | + # php artisan cache:clear + # php artisan view:clear + # php artisan route:clear + # php artisan config:clear + + - name: Restart PHP service + run: sudo systemctl restart php8.2-fpm + + - name: Restart Nginx + run: sudo systemctl restart nginx \ No newline at end of file