feat: add gitlab-ci.yml

This commit is contained in:
shizhendong
2021-06-18 10:40:50 +08:00
parent 50e1d8f04b
commit 0aa1581314
2 changed files with 35 additions and 0 deletions

26
.gitlab-ci.yml Normal file
View File

@@ -0,0 +1,26 @@
stages:
- build_project
- build_image
build_project:
stage: build_project
script:
- echo "npm install ..."
- sudo npm install
- echo "npm run build"
- sudo npm run build
only:
- dev-cicd
tags:
- GN-XXG-Server
build_image:
stage: build_image
script:
- docker build -t "${CI_REGISTRY_IMAGE}_cn-ui:latest" .
- docker push "${CI_REGISTRY_IMAGE}_cn-ui:latest"
when: on_success
only:
- dev-cicd
tags:
- GN-XXG-Server

9
Dockerfile Normal file
View File

@@ -0,0 +1,9 @@
FROM nginx:latest
MAINTAINER shizhendong shizhendong@zdjizhi.com
# 将dist文件中的内容复制到 /usr/share/nginx/html/ 这个目录下面
COPY dist/ /usr/share/nginx/html/
# nginx 配置 制作镜像时不做处理 容器可自己挂载配置文件
#COPY nginx.conf /etc/nginx/nginx.conf