From 291997caa5476a7da2aa7ee59f800e879a55aeb4 Mon Sep 17 00:00:00 2001 From: DaX Date: Thu, 5 Mar 2026 01:42:01 +0100 Subject: [PATCH] Fix migration step: create api/ subdirectory and run migrate from project root mkdir -p the api/ and database/ directories before copying files since EC2 only has server.js at the project root. Run migrate.js from project root so dotenv picks up the .env file correctly. --- .gitea/workflows/deploy.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 78bf64f..749a928 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -151,14 +151,16 @@ jobs: --parameters 'commands=[ "set -e", "cd /tmp", + "rm -rf repo.tar.gz filamenteka", "curl -sf -o repo.tar.gz https://git.demirix.dev/dax/Filamenteka/archive/main.tar.gz", "tar xzf repo.tar.gz", - "cp -r filamenteka/database /home/ubuntu/filamenteka-api/database", + "mkdir -p /home/ubuntu/filamenteka-api/api /home/ubuntu/filamenteka-api/database/migrations", + "cp -r filamenteka/database/* /home/ubuntu/filamenteka-api/database/", "cp filamenteka/api/migrate.js /home/ubuntu/filamenteka-api/api/migrate.js", "rm -rf repo.tar.gz filamenteka", "echo Migration files:", "ls -la /home/ubuntu/filamenteka-api/database/migrations/", - "cd /home/ubuntu/filamenteka-api/api && node migrate.js" + "cd /home/ubuntu/filamenteka-api && node api/migrate.js" ]' \ --output json \ --query "Command.CommandId" --output text)