diff --git a/.woodpecker.yml b/.woodpecker.yml index 2296e45..b2dd69b 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,24 +1,35 @@ -when: - branch: main - event: [push, manual] - -steps: - install-client: - image: node:20-alpine - commands: - - cd client && npm ci - - build-client: - image: node:20-alpine - commands: - - cd client && npm run build - depends_on: [install-client] - - deploy: - image: alpine:latest - volumes: - - /root/.ssh:/root/.ssh:ro - commands: - - apk add --no-cache openssh - - ssh -o StrictHostKeyChecking=no -i /root/.ssh/deploy_chat root@192.168.1.80 'cd /opt/min-chat && git pull origin main && cd server && npm install --omit=dev && cd .. && cd client && npm ci && npm run build && cd .. && cp -r client/dist/* /var/www/html/ 2>/dev/null || true && systemctl restart chat-app' - depends_on: [build-client] +when: + branch: main + event: [push, manual] + +steps: + install-client: + image: node:20 + commands: + - cd client && npm install + + build-client: + image: node:20 + commands: + - cd client && npm run build + depends_on: [install-client] + + deploy: + image: alpine:latest + environment: + DEPLOY_KEY: + from_secret: deploy_key + commands: + - apk add --no-cache openssh + - mkdir -p /ssh + - echo "$DEPLOY_KEY" > /ssh/deploy_key + - chmod 600 /ssh/deploy_key + - ssh -i /ssh/deploy_key -o StrictHostKeyChecking=no root@192.168.1.80 ' + cd /opt/min-chat && + git pull origin main && + cd server && npm install --omit=dev && cd .. && + cd client && npm install && npm run build && cd .. && + cp -r client/dist/* /var/www/html/ 2>/dev/null || true && + systemctl restart chat-app + ' + depends_on: [build-client] diff --git a/server/users.json b/server/users.json index 2418d91..5174263 100644 --- a/server/users.json +++ b/server/users.json @@ -1,4 +1,5 @@ [ { "login": "Danil", "password": "456" }, - { "login": "charlie", "password": "789" } + { "login": "Kirill", "password": "123" }, + { "login": "Sergiy", "password": "999" } ]