这是一个共同的主题吗?例如:构建时我已经在构建。但是当我部署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