mirror of
https://gitee.com/270580156/weiyu.git
synced 2026-05-14 11:18:02 +00:00
1 line
4.1 KiB
JavaScript
1 line
4.1 KiB
JavaScript
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8576],{412:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>a,contentTitle:()=>o,default:()=>u,frontMatter:()=>l,metadata:()=>t,toc:()=>c});const t=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":"/bytedesk/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":"/bytedesk/docs/deploy/cicd/agent"},"next":{"title":"Developer Docs","permalink":"/bytedesk/docs/deploy/cicd/devdoc"}}');var s=i(5723),r=i(6246);const l={sidebar_label:"Visitor Client",sidebar_position:4},o="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(e){const n={admonition:"admonition",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",pre:"pre",ul:"ul",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.header,{children:(0,s.jsx)(n.h1,{id:"visitor-client-cicd",children:"Visitor Client CI/CD"})}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Operating System: Ubuntu 20.04 LTS"}),"\n",(0,s.jsx)(n.li,{children:"Server Requirements: Minimum 2 cores 4GB RAM, Recommended 4 cores 8GB RAM"}),"\n"]})}),"\n",(0,s.jsx)(n.h2,{id:"github-actions",children:"GitHub Actions"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.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,s.jsx)(n.h2,{id:"gitlab-ci",children:"GitLab CI"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.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,s.jsx)(n.h2,{id:"jenkins-pipeline",children:"Jenkins Pipeline"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.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(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},6246:(e,n,i)=>{i.d(n,{R:()=>l,x:()=>o});var t=i(2155);const s={},r=t.createContext(s);function l(e){const n=t.useContext(r);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:l(e.components),t.createElement(r.Provider,{value:n},e.children)}}}]); |