From 270313c12095fc3f680d5a7a2ca0f85e94383ef1 Mon Sep 17 00:00:00 2001 From: jakub <jakub@elixxir.io> Date: Fri, 17 Dec 2021 21:35:35 +0100 Subject: [PATCH] Add CI from template --- .dockerignore | 2 ++ .gitlab-ci.yml | 27 +++++++++++++++++++++++++++ Dockerfile | 10 ++++++++++ docker-compose.yml | 18 ++++++++++++++++++ 4 files changed, 57 insertions(+) create mode 100644 .dockerignore create mode 100644 .gitlab-ci.yml create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..27d2dae --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +*/node_modules +*.log diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..d54ccb8 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,27 @@ +image: node:15.12-alpine3.13 + +stages: + - test + - deploy + +test: + stage: test + script: + - cd docusaurus-site + - yarn install + - yarn build + rules: + - if: $CI_COMMIT_REF_NAME != $CI_DEFAULT_BRANCH + +pages: + stage: deploy + script: + - cd docusaurus-site + - yarn install + - yarn build + - mv ./build ../public + artifacts: + paths: + - public + rules: + - if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b34dacb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM node:lts + +WORKDIR /app/website + +EXPOSE 3000 35729 +#COPY ./docs /app/docs +COPY ./docusaurus-site /app/website +RUN yarn install + +CMD ["yarn", "start"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..d748dc2 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,18 @@ +version: "3" + +services: + docusaurus: + build: . + ports: + - 3000:3000 + - 35729:35729 + volumes: + - ./docs:/app/docs + - ./docusaurus-site/blog:/app/website/blog + - ./docusaurus-site/core:/app/website/core + - ./docusaurus-site/i18n:/app/website/i18n + - ./docusaurus-site/pages:/app/website/pages + - ./docusaurus-site/static:/app/website/static + - ./docusaurus-site/sidebars.json:/app/website/sidebars.json + - ./docusaurus-site/siteConfig.js:/app/website/siteConfig.js + working_dir: /app/website -- GitLab