From ab3ce486c562aeb8114dd772244ffd5c0d7a7679 Mon Sep 17 00:00:00 2001 From: Dobrunia Kostrigin <48620984+Dobrunia@users.noreply.github.com> Date: Mon, 13 Oct 2025 19:56:35 +0300 Subject: [PATCH 1/2] Update GitHub Actions workflow for deployment: upgraded actions to v4, removed unnecessary steps for creating and copying server files, and adjusted FTP upload settings to exclude specific directories. --- .github/workflows/deploy.yml | 36 +++++------------------------------- 1 file changed, 5 insertions(+), 31 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 419d022..bb910c8 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -14,51 +14,25 @@ jobs: steps: - name: Checkout repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 18 - name: Install dependencies run: npm install - - name: Create deployment directory - run: mkdir -p deploy - - - name: Copy server files - run: | - cp -r src/ deploy/ - cp -r node_modules/ deploy/ - cp package.json deploy/ - cp package-lock.json deploy/ - cp .env deploy/ || echo "No .env file found" - - - name: Create server startup script - run: | - cat > deploy/start.sh << 'EOF' - #!/bin/bash - echo "Starting Dayframe Server..." - cd /path/to/server - npm start - EOF - chmod +x deploy/start.sh - - name: Upload via FTP uses: SamKirkland/FTP-Deploy-Action@v4.3.4 with: server: ${{ secrets.FTP_HOST }} username: ${{ secrets.FTP_USERNAME }} password: ${{ secrets.FTP_PASSWORD }} - local-dir: ./deploy/ - server-dir: /server/ + local-dir: ./ exclude: | **/.git* **/.git*/** - **/node_modules/.cache/** - **/coverage/** - **/.nyc_output/** - **/.env.local - **/.env.development - **/.env.test + **/node_modules/** + **/.github/** From 662aed58b898393d23fa7d2801f4b31e2e473382 Mon Sep 17 00:00:00 2001 From: Dobrunia Kostrigin <48620984+Dobrunia@users.noreply.github.com> Date: Mon, 13 Oct 2025 22:09:45 +0300 Subject: [PATCH 2/2] Remove hello.js and update package.json to change the start script to main.js --- hello.js => main.js | 0 package.json | 3 +-- 2 files changed, 1 insertion(+), 2 deletions(-) rename hello.js => main.js (100%) diff --git a/hello.js b/main.js similarity index 100% rename from hello.js rename to main.js diff --git a/package.json b/package.json index d403b17..f01ec2a 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,8 @@ { "name": "dayframe-server", "version": "1.0.0", - "main": "hello.js", "scripts": { - "start": "node hello.js", + "start": "node main.js", "init_db": "node src/scripts/initDb.js", "seed_db": "node src/scripts/seedInitialData.js", "create_env": "node -e \"require('fs').copyFileSync('.env.example', '.env'); console.log('✅ .env создан из шаблона .env.example. Пожалуйста, отредактируйте файл .env перед продолжением.')\"",