From 7944db21f25f6077b073cb18daf0237f6f8545e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9D=D0=B8=D0=BA=D0=B8=D1=82=D0=B0=20=D0=9A=D1=80=D1=83?= =?UTF-8?q?=D0=B3=D0=BB=D0=B8=D1=86=D0=BA=D0=B8=D0=B9?= Date: Thu, 20 Nov 2025 21:18:16 +0600 Subject: [PATCH] deploy --- .gitea/workflows/deploy.yml | 40 +++++++++++++++++++++++++ Dockerfile | 15 ++++++++++ src/composables/useCollaborativeFlow.ts | 2 +- 3 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 .gitea/workflows/deploy.yml create mode 100644 Dockerfile diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..280ca21 --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,40 @@ +name: Deploy + +on: + push: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Keyscan + run: | + ssh-keyscan git.koptilnya.xyz >> ~/.ssh/known_hosts + + - name: Checkout + uses: actions/checkout@v4 + with: + ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} + ssh-strict: false + persist-credentials: false + + - name: Build + run: docker build -t bpmn:latest . + + - name: Stop old container + run: docker rm -f bpmn || true + + - name: Run + run: | + docker run -d \ + --name bpmn \ + --network traefik \ + --label "traefik.enable=true" \ + --label "traefik.http.routers.bpmn.rule=Host(\`bpmn.koptilnya.xyz\`)" \ + --label "traefik.http.routers.bpmn.entrypoints=websecure" \ + --label "traefik.http.routers.bpmn.tls.certresolver=myresolver" \ + --label "traefik.http.services.bpmn.loadbalancer.server.port=80" \ + bpmn:latest diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a01b42f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM node:22-alpine AS build +WORKDIR /app +RUN corepack enable +COPY package.json yarn.lock ./ +RUN yarn install +COPY . . +RUN yarn build + +FROM nginx:stable-alpine + +COPY --from=build /app/dist /usr/share/nginx/html + +EXPOSE 80 + +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/src/composables/useCollaborativeFlow.ts b/src/composables/useCollaborativeFlow.ts index b232ea0..a7d923b 100644 --- a/src/composables/useCollaborativeFlow.ts +++ b/src/composables/useCollaborativeFlow.ts @@ -186,7 +186,7 @@ export function useCollaborativeFlow(diagramId: MaybeRefOrGetter) { return provider.value = new WebsocketProvider( - 'ws://localhost:1234', + import.meta.env.DEV ? 'ws://localhost:1234' : 'wss://api/koptilnya.xyz/bpmn', diagramId, yDoc, )