From 8f0a667de297047367d2844a8bae964156c76c0b Mon Sep 17 00:00:00 2001 From: msumshk Date: Thu, 5 Feb 2026 15:08:50 +0800 Subject: [PATCH] feat: add Gitea Actions CI/CD workflow --- .gitea/workflows/deploy.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .gitea/workflows/deploy.yml diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..446674b --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,34 @@ +name: Build and Deploy AdminApi + +on: + push: + branches: + - dev + +jobs: + build-and-deploy: + runs-on: host + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Build Docker image + run: | + docker build -t takeoutsaas-adminapi:latest -f src/Api/TakeoutSaaS.AdminApi/Dockerfile . + + - name: Deploy container + run: | + docker stop adminapi || true + docker rm adminapi || true + docker run -d \ + --name adminapi \ + --restart unless-stopped \ + -p 7801:7801 \ + -e ASPNETCORE_ENVIRONMENT=Production \ + takeoutsaas-adminapi:latest + + - name: Clean up old images + run: | + docker image prune -f