作者 谢彪
1 个管道 的构建 取消

commit yml

1 # .gitlab-ci.yml 1 # .gitlab-ci.yml
2 image: node:latest 2 image: node:latest
3 3
4 -stages: 4 +stages:
  5 + - build
5 - deploy 6 - deploy
6 7
  8 +cache:
  9 + paths:
  10 + - node_modules/
  11 +
  12 +build:
  13 + stage: build
  14 + script:
  15 + - npm install
  16 + - npm run build
  17 + artifacts:
  18 + paths:
  19 + - build/
  20 +
7 deploy: 21 deploy:
8 stage: deploy 22 stage: deploy
9 script: 23 script:
10 - mkdir -p public 24 - mkdir -p public
11 - - cp -r html/* public/ 25 + - cp -r build/* public/
12 artifacts: 26 artifacts:
13 paths: 27 paths:
14 - public 28 - public
15 only: 29 only:
16 - - master # 或者你希望触发部署的分支  
  30 + - main # 或者你希望触发部署的分支