如何将GitLab Shared Runners部署到服务器

问题描述 投票:2回答:1

我想部署我的反应应用程序。

我认为使用ssh,但文档说如何使用自己的gitlab运行程序使用ssh密钥,但我想使用共享运行程序。

我不知道如何将build文件夹发送到我的服务器,我是ftp中的东西但是最好的方法是什么?

我不使用docker,只是普通的apache服务器。

continuous-integration gitlab-ci
1个回答
0
投票

我找到了解决方案

image: node:latest

cache:
  paths:
  - node_modules/

stages:
  - deploy

deploy:
  stage: deploy
  script:
    - unset CI
    - npm install
    - npm run build
    - apt-get update -qq && apt-get install -y -qq lftp
    - lftp -c "set ftp:ssl-allow no; open -u $USERNAME,$PASSWORD $HOST; mirror -R ./build $DEV_FOLDER --Remove-source-files --delete-first --parallel=10 --exclude-glob .git* --exclude .htaccess --exclude .git/"
  only:
    - master

© www.soinside.com 2019 - 2024. All rights reserved.