From 20a5f506da276c4fbbc636d8367f94f8d7a8c7e5 Mon Sep 17 00:00:00 2001 From: Oscar Date: Wed, 27 May 2026 20:38:51 +0300 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(file/topic):=20=D0=94=D0=BE?= =?UTF-8?q?=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=20=D1=84=D0=B0=D0=B9=D0=BB?= =?UTF-8?q?=20=D0=B4=D0=B5=D0=BF=D0=BB=D0=BE=D1=8F=20=D0=B4=D0=BB=D1=8F=20?= =?UTF-8?q?Gitea=20=D1=81=20CI/CD=20[Russian]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/deploy.yml | 52 +++++++++++++++++++++++++++++++++++++ Dockerfile | 1 + package.json | 2 +- 3 files changed, 54 insertions(+), 1 deletion(-) 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..0c23167 --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,52 @@ +name: Deploy + +on: + push: + branches: + - main + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - name: Keyscan + run: | + ssh-keyscan git.koptilnya.xyz >> ~/.ssh/known_hosts + + - name: Set up secret file + env: + TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} + run: | + echo "${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}" | sed 's/./& /g' + + - name: Checkout + uses: actions/checkout@v4 + with: + ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} + ssh-strict: false + persist-credentials: false + + # - name: Backup DB + # run: cp /home/koptilnya/services/chad/data/database.db /home/koptilnya/services/chad/database-$(date+"%d-%m-%Y").db + + - name: Build + run: docker build -t hh-auto-reply ./server + + - name: Stop old container + run: docker rm -f hh-auto-reply || true + + - name: Run + run: | + docker run -d \ + --name hh-auto-reply \ + --network traefik \ + --volume /home/koptilnya/services/chad/data:/app/data \ + -p 40000-40100:40000-40100/udp \ + --label "traefik.enable=true" \ + --label "traefik.http.routers.hh-auto-reply.rule=Host(\`api.koptilnya.xyz\`) && PathPrefix(\`/hh-auto-reply\`)" \ + --label "traefik.http.routers.hh-auto-reply.entrypoints=websecure" \ + --label "traefik.http.routers.hh-auto-reply.tls=true" \ + --label "traefik.http.routers.hh-auto-reply.tls.certresolver=myresolver" \ + --label "traefik.http.services.hh-auto-reply.loadbalancer.server.port=80" \ + hh-auto-reply:latest diff --git a/Dockerfile b/Dockerfile index 34552a6..262f6ff 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,6 +23,7 @@ RUN yarn prisma generate && yarn build FROM node:22-slim AS runner WORKDIR /app +RUN yarn prisma migrate deploy RUN corepack enable diff --git a/package.json b/package.json index c7b818f..868141b 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,8 @@ "build": "tsc", "start": "node --env-file=.env dist/index.js", "db-view": "yarn prisma studio", + "db:deploy": "npx prisma migrate deploy && npx prisma generate", "db-migrate": "npx prisma migrate dev", - "db-deploy": "npx prisma migrate deploy", "db-migrate-server": "git pull npx prisma migrate deploy", "lint": "eslint .", "lint:fix": "eslint . --fix"