为什么在构建然后部署时必须运行两次构建?

时间:2018-12-05 04:01:05

标签: npm deployment

这是一个共同的主题吗?例如:构建时我已经在构建。但是当我部署Web应用程序时,我又将其构建了两次吗?这是正确的方法吗?如果是这样,为什么会这样呢?

build site:
  image: node:latest
  stage: build
  script:
    - npm install --progress=false
    - npm run build
  artifacts:
    expire_in: 1 week
    paths:
      - dist

pages: 
  image: node:latest
  stage: deploy
  script:
    - npm install --progress=false
    - npm run build
    - rm -rf public
    - mkdir public
    - cp -r dist/* public
  artifacts:
    expire_in: 1 week
    paths:
      - public # artifact path must be /public for GitLab Pages to pick it up
  only:
    - master    

0 个答案:

没有答案
相关问题