From 19ee748ee7b1be6fb1ee90cbb9501a4404573f2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20L=C3=A1szl=C3=B3?= <rlacko99@gmail.com> Date: Tue, 11 May 2021 23:41:13 +0200 Subject: [PATCH] add ci config --- .gitlab-ci.yml | 33 +++++++++++++++++++++++++++++++++ Dockerfile | 3 +++ nginx.conf | 13 +++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 .gitlab-ci.yml create mode 100644 Dockerfile create mode 100644 nginx.conf diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..fb8f880 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,33 @@ +include: + - project: kszk/ci + ref: 0.2.0 + file: + - /template/docker-build.yaml + - /template/ssh-deploy.yaml + +stages: + - build + - docker + - deploy + +compile: + stage: build + tags: [docker] + image: trion/ng-cli + script: + - ng build --prod + artifacts: + expire_in: 1 day + paths: + - dist/ + +dockerhub: + extends: .docker-build-dockerhub + stage: docker + tags: [docker] + only: + - tags + - master + variables: + IMAGE_NAME: rlacko58/kszk-status-angular + IMAGE_TAG: $CI_COMMIT_SHORT_SHA diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e448c3f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +FROM nginx:1.19.10 +COPY nginx.conf /etc/nginx/nginx.conf +COPY /dist/kszk-status-angular /usr/share/nginx/html diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..a317292 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,13 @@ +events{} +http { + include /etc/nginx/mime.types; + server { + listen 80; + server_name localhost; + root /usr/share/nginx/html; + index index.html; + location / { + try_files $uri $uri/ /index.html; + } + } +} -- GitLab