mirror of
https://github.com/TeachBooks/manual.git
synced 2026-11-13 06:45:52 +00:00
Merge branch 'publish' into 'main'
Update CI See merge request interactivetextbooks-citg/jupyter-book-manual!32
This commit is contained in:
commit
e4676bdd92
2 changed files with 12 additions and 4 deletions
|
|
@ -3,6 +3,7 @@ image: continuumio/miniconda:latest
|
|||
stages:
|
||||
- test
|
||||
- build
|
||||
- deploy
|
||||
|
||||
variables:
|
||||
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
|
||||
|
|
@ -38,14 +39,21 @@ build-book:
|
|||
before_script:
|
||||
- docker info
|
||||
script:
|
||||
- docker build -t $TAG_LATEST
|
||||
- docker build -t $TAG_LATEST .
|
||||
- docker push $TAG_LATEST
|
||||
- docker image prune -f
|
||||
|
||||
deploy-book:
|
||||
stage: deploy
|
||||
image: docker
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == "publish" && $CI_PIPELINE_SOURCE == "push"
|
||||
before_script:
|
||||
- docker info
|
||||
- docker stop $CI_PROJECT_NAME || exit_code=$?
|
||||
- if [ $exit_code -ne 0 ]; then echo "Container $CI_PROJECT_NAME not found, cannot stop"; else docker rm $CI_PROJECT_NAME; fi
|
||||
script:
|
||||
- docker compose -f /etc/web_server/docker-compose.yml pull
|
||||
- docker compose -f /etc/web_server/docker-compose.yml up -d --no-deps manual
|
||||
- docker run -d --restart always -p 8000:8000 --name $CI_PROJECT_NAME $TAG_LATEST
|
||||
environment:
|
||||
name: production
|
||||
url: https://interactivetextbooks.citg.tudelft.nl/$CI_PROJECT_NAME
|
||||
|
|
@ -5,4 +5,4 @@ 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" ]
|
||||
ENTRYPOINT [ "python", "-m", "http.server", "8000", "--directory", "/book/_build/html" ]
|
||||
Loading…
Add table
Add a link
Reference in a new issue