From 93802ef91672da3cef2b2d3c12fb8f41974296d7 Mon Sep 17 00:00:00 2001 From: Dhaverd Date: Thu, 17 Jul 2025 20:28:14 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=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 | 44 ++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .gitea/workflows/action.yaml diff --git a/.gitea/workflows/action.yaml b/.gitea/workflows/action.yaml new file mode 100644 index 0000000..d306ae0 --- /dev/null +++ b/.gitea/workflows/action.yaml @@ -0,0 +1,44 @@ +name: Deploy Wishlist +on: + push: + branches: [ master ] + +env: + DEPLOY_DIR: ${{ secrets.DEPLOY_DIR }} + +jobs: + deploy: + runs-on: ubuntu + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Create .env file from secrets + run: | + echo "$ENV_PROD" > .env + if [ ! -s .env ]; then + echo "Error: .env file is empty!" + exit 1 + fi + env: + ENV_PROD: ${{ secrets.ENV_PROD }} + + - 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: | + chmod -R 777 ./ + sudo rsync -av ./ ${DEPLOY_DIR}/ + + - 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