正在显示
1 个修改的文件
包含
16 行增加
和
2 行删除
| @@ -2,15 +2,29 @@ | @@ -2,15 +2,29 @@ | ||
| 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 # 或者你希望触发部署的分支 |
-
请 注册 或 登录 后发表评论