mirror of
https://gitee.com/270580156/weiyu.git
synced 2026-05-14 11:18:02 +00:00
1 line
4.0 KiB
JavaScript
1 line
4.0 KiB
JavaScript
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8576],{412:(n,e,i)=>{i.r(e),i.d(e,{assets:()=>a,contentTitle:()=>l,default:()=>u,frontMatter:()=>o,metadata:()=>s,toc:()=>c});const s=JSON.parse('{"id":"deploy/cicd/visitor","title":"Visitor Client CI/CD","description":"- Operating System: Ubuntu 20.04 LTS","source":"@site/i18n/en/docusaurus-plugin-content-docs/current/deploy/cicd/visitor.md","sourceDirName":"deploy/cicd","slug":"/deploy/cicd/visitor","permalink":"/docs/docs/deploy/cicd/visitor","draft":false,"unlisted":false,"editUrl":"https://github.com/bytedesk/bytedesk/docs/deploy/cicd/visitor.md","tags":[],"version":"current","sidebarPosition":4,"frontMatter":{"sidebar_label":"Visitor Client","sidebar_position":4},"sidebar":"tutorialSidebar","previous":{"title":"Agent Client","permalink":"/docs/docs/deploy/cicd/agent"},"next":{"title":"Developer Docs","permalink":"/docs/docs/deploy/cicd/devdoc"}}');var t=i(5723),r=i(6246);const o={sidebar_label:"Visitor Client",sidebar_position:4},l="Visitor Client CI/CD",a={},c=[{value:"GitHub Actions",id:"github-actions",level:2},{value:"GitLab CI",id:"gitlab-ci",level:2},{value:"Jenkins Pipeline",id:"jenkins-pipeline",level:2}];function d(n){const e={admonition:"admonition",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",pre:"pre",ul:"ul",...(0,r.R)(),...n.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(e.header,{children:(0,t.jsx)(e.h1,{id:"visitor-client-cicd",children:"Visitor Client CI/CD"})}),"\n",(0,t.jsx)(e.admonition,{type:"tip",children:(0,t.jsxs)(e.ul,{children:["\n",(0,t.jsx)(e.li,{children:"Operating System: Ubuntu 20.04 LTS"}),"\n",(0,t.jsx)(e.li,{children:"Server Requirements: Minimum 2 cores 4GB RAM, Recommended 4 cores 8GB RAM"}),"\n"]})}),"\n",(0,t.jsx)(e.h2,{id:"github-actions",children:"GitHub Actions"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-yaml",children:'name: Build and Deploy Visitor\n\non:\n push:\n branches: [ main ]\n pull_request:\n branches: [ main ]\n\njobs:\n build:\n runs-on: ubuntu-latest\n \n steps:\n - uses: actions/checkout@v2\n \n - name: Setup Node.js\n uses: actions/setup-node@v2\n with:\n node-version: \'16.x\'\n \n - name: Install Dependencies\n run: yarn install\n \n - name: Build\n run: yarn build\n \n - name: Deploy\n uses: appleboy/scp-action@master\n with:\n host: ${{ secrets.HOST }}\n username: ${{ secrets.USERNAME }}\n key: ${{ secrets.SSH_KEY }}\n source: "dist/*"\n target: "/var/www/html/weiyuai/chat/"\n'})}),"\n",(0,t.jsx)(e.h2,{id:"gitlab-ci",children:"GitLab CI"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-yaml",children:"stages:\n - build\n - deploy\n\nbuild:\n stage: build\n image: node:16\n script:\n - yarn install\n - yarn build\n artifacts:\n paths:\n - dist/\n\ndeploy:\n stage: deploy\n script:\n - rsync -avz --delete dist/ user@server:/var/www/html/weiyuai/chat/\n only:\n - main\n"})}),"\n",(0,t.jsx)(e.h2,{id:"jenkins-pipeline",children:"Jenkins Pipeline"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-groovy",children:"pipeline {\n agent any\n \n stages {\n stage('Build') {\n steps {\n sh 'yarn install'\n sh 'yarn build'\n }\n }\n \n stage('Deploy') {\n steps {\n sh 'rsync -avz --delete dist/ user@server:/var/www/html/weiyuai/chat/'\n }\n }\n }\n}\n"})})]})}function u(n={}){const{wrapper:e}={...(0,r.R)(),...n.components};return e?(0,t.jsx)(e,{...n,children:(0,t.jsx)(d,{...n})}):d(n)}},6246:(n,e,i)=>{i.d(e,{R:()=>o,x:()=>l});var s=i(2155);const t={},r=s.createContext(t);function o(n){const e=s.useContext(r);return s.useMemo((function(){return"function"==typeof n?n(e):{...e,...n}}),[e,n])}function l(n){let e;return e=n.disableParentContext?"function"==typeof n.components?n.components(t):n.components||t:o(n.components),s.createElement(r.Provider,{value:e},n.children)}}}]); |