diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6e523a7..61a660f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -33,44 +33,20 @@ test-build: build-book: stage: build - rules: - - if: $CI_COMMIT_BRANCH == "publish" && $CI_PIPELINE_SOURCE == "push" - before_script: - - python -V - - conda env create -f environment.yml - - conda init bash - - source ~/.bashrc - - conda activate jupyter-book-env - script: - - jupyter-book clean book/ - - jupyter-book build book/ - artifacts: - expire_in: 30 days - paths: - - book/_build/html/ - -build-container: image: docker - stage: build rules: - if: $CI_COMMIT_BRANCH == "publish" && $CI_PIPELINE_SOURCE == "push" - needs: - - build-book before_script: - docker info script: - - docker build -t $TAG_COMMIT -t $TAG_LATEST . - - docker push $TAG_COMMIT + - docker build -t $TAG_LATEST - docker push $TAG_LATEST -update-website: - image: docker +deploy-book: stage: deploy + image: docker rules: - if: $CI_COMMIT_BRANCH == "publish" && $CI_PIPELINE_SOURCE == "push" script: - - docker-compose pull $CI_PROJECT_NAME - - docker-compose up -d - environment: - name: production - url: https://interactivetextbooks.citg.tudelft.nl/ \ No newline at end of file + - docker compose -f /etc/web_server/docker-compose.yml pull + - docker compose -f /etc/web_server/docker-compose.yml up -d --no-deps manual \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 4a05cdd..65563bf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,8 @@ -FROM httpd:latest - -COPY ./book/_build/html /usr/local/apache2/htdocs \ No newline at end of file +FROM continuumio/miniconda3 +WORKDIR /book +COPY book/ . +RUN apt-get update && apt-get -y install git gcc +COPY requirements.txt requirements.txt +RUN pip install -r requirements.txt +RUN jupyter book build . +ENTRYPOINT [ "python", "-m", "http.server", "8000", "--directory", "_build/html" ] \ No newline at end of file