From 0c14ad7e5505b3de39d89234282f772c1fb84123 Mon Sep 17 00:00:00 2001 From: "Kalana B. Thilakarathna" Date: Tue, 6 Oct 2026 15:11:23 +0530 Subject: [PATCH 1/2] Add CI/CD workflow for automated production deployment Added ci-cd.yml GitHub Actions workflow to automate CI/CD for Vijaya Core. Triggers on merged PRs to production, builds and deploys linux-x64 self-contained app, manages service lifecycle, and ensures correct permissions and service status. --- .gitea/workflows/ci-cd.yml | 48 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .gitea/workflows/ci-cd.yml diff --git a/.gitea/workflows/ci-cd.yml b/.gitea/workflows/ci-cd.yml new file mode 100644 index 0000000..7322a2e --- /dev/null +++ b/.gitea/workflows/ci-cd.yml @@ -0,0 +1,48 @@ +name: CI/CD - Vijaya Core +on: + pull_request: + branches: + - production + types: + - closed +jobs: + build-and-deploy: + name: Build & Deploy + runs-on: linux + if: github.event.pull_request.merged == true + steps: + - name: Checkout code + run: | + git clone \ + --depth 1 \ + --branch production \ + https://oauth2:${{ secrets.VIJAYA }}@gitea.hexdive.com/Vijaya_Gym/Core_Be.git \ + . + - name: Restore + run: dotnet restore Fitness-core-BE.sln + - name: Publish + run: | + rm -rf /tmp/vijayacore-deploy + mkdir -p /tmp/vijayacore-deploy + dotnet publish Fitness_core_BE.csproj \ + -c Release \ + -r linux-x64 \ + --self-contained true \ + -o /tmp/vijayacore-deploy + - name: Stop service + run: systemctl stop vijayacore.service + - name: Copy to deploy folder + run: | + rm -rf /home/vijayasport/core/publish/* + cp -r /tmp/vijayacore-deploy/* /home/vijayasport/core/publish/ + - name: Fix ownership and permissions + run: | + chown -R vijayasportuser:vijayasportuser /home/vijayasport/core/publish + find /home/vijayasport/core/publish -type d -exec chmod 755 {} + + find /home/vijayasport/core/publish -type f -exec chmod 644 {} + + chmod +x /home/vijayasport/core/publish/Fitness_core_BE + - name: Restart service + run: systemctl restart vijayacore.service + - name: Verify + run: | + systemctl is-active vijayacore.service && echo "✅ Service running" || echo "❌ Service failed" From b812634f8e582fa9f03002377941de81933f88ac Mon Sep 17 00:00:00 2001 From: "Kalana B. Thilakarathna" Date: Tue, 6 Oct 2026 16:19:13 +0530 Subject: [PATCH 2/2] appsettings update --- appsettings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appsettings.json b/appsettings.json index d3cd013..8b09d11 100644 --- a/appsettings.json +++ b/appsettings.json @@ -12,7 +12,7 @@ "Kestrel": { "Endpoints": { "Http": { - "Url": "http://0.0.0.0:5601" + "Url": "http://0.0.0.0:5632" } },