diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000000..9052da6172 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,63 @@ +version: 2 + +jobs: + docs-build: + docker: + - image: python:3.7 + steps: + - checkout + - run: + name: Install dependencies + command: | + apt-get update + apt-get install --no-install-recommends -y texlive-base texlive-latex-base texlive-latex-recommended texlive-fonts-recommended texlive-fonts-extra texlive-latex-extra texlive-formats-extra texlive-bibtex-extra texlive-humanities texlive-lang-italian texinfo texlive-science latexmk + apt-get autoremove + apt-get clean + rm -rf /var/lib/apt/lists/* + - run: + name: Compile SPHINX + command: | + pip install -r requirements.txt + make html + make latexpdf + cp _build/latex/*.pdf _build/html/ + make epub + cp _build/epub/*.epub _build/html/ + touch _build/html/.nojekyll + - persist_to_workspace: + root: _build + paths: + - html + docs-deploy: + docker: + - image: node:8.10.0 + steps: + - add_ssh_keys: + fingerprints: + - "50:c0:de:85:b0:a3:35:40:b1:29:2e:a7:c1:04:bf:09" + - checkout + - attach_workspace: + at: _build + - run: + name: Install and configure dependencies + command: | + npm install -g --silent gh-pages@2.0.1 + git config user.email "marco.spasiano@gmail.com" + git config user.name "marco.spasiano" + - run: + name: Deploy docs to gh-pages branch + command: gh-pages --dist _build/html +workflows: + version: 2 + build-and-deploy: + jobs: + - docs-build: + filters: + branches: + only: master + - docs-deploy: + requires: + - docs-build + filters: + branches: + only: master \ No newline at end of file