diff --git a/.circleci/config.yml b/.circleci/config.yml index 536d276..b111c9a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,11 +1,14 @@ version: 2 jobs: - build: + test: docker: - image: circleci/python:3.9.6 environment: # environment variables for primary container PIPENV_VENV_IN_PROJECT: true steps: # steps that comprise the `build` job + - add_ssh_keys: + fingerprints: + - "c8:f7:fc:a0:0d:2c:43:93:e3:c7:b6:cf:16:93:98:e1" - checkout # check out source code to working directory - run: sudo chown -R circleci:circleci /usr/local/bin - restore_cache: @@ -24,3 +27,38 @@ jobs: - run: command: | make coverage + docs-build-deploy: + docker: + - image: circleci/python:3.9.6 + environment: # environment variables for primary container + PIPENV_VENV_IN_PROJECT: true + steps: + - add_ssh_keys: + fingerprints: + - "c8:f7:fc:a0:0d:2c:43:93:e3:c7:b6:cf:16:93:98:e1" + - checkout + - run: sudo chown -R circleci:circleci /usr/local/bin + - restore_cache: + key: deps9-{{ .Branch }}-{{ checksum "Pipfile.lock" }} + - run: + command: | + make setup + - save_cache: + key: deps9-{{ .Branch }}-{{ checksum "Pipfile.lock" }} + paths: + - "venv" + - run: + command: | + git config --local user.email "sysadmin@binary.com" + git config --local user.name "gh-pages deploy bot" + make gh-pages +workflows: + version: 2 + build: + jobs: + - test + - docs-build-deploy: + filters: + branches: + only: + - master diff --git a/Makefile b/Makefile index 190f5c8..fdbcf6d 100644 --- a/Makefile +++ b/Makefile @@ -5,10 +5,10 @@ setup: test: pipenv run python setup.py pytest doc: - pdoc deriv_api --force --html -o docs/html --template-dir docs/templates -gh-pages: - pdoc deriv_api --force --html -o /tmp/python-deriv-api-docs --template-dir docs/templates && git add . && git stash && git checkout gh-pages && cp -r /tmp/python-deriv-api-docs/deriv_api/* . && git add . && git commit -m 'Update docs' && git push && git checkout - + pipenv run pdoc deriv_api --force --html -o docs/html --template-dir docs/templates build: pip3 install build && python3 -m build coverage: pipenv run coverage run --source deriv_api -m pytest && pipenv run coverage report -m +gh-pages: + pipenv run pdoc deriv_api --force --html -o /tmp/python-deriv-api-docs --template-dir docs/templates && git add -A . && git stash && git checkout gh-pages && cp -r /tmp/python-deriv-api-docs/deriv_api/* . && git add -A . && git commit -m 'Update docs' && git push origin gh-pages && git checkout - diff --git a/README.md b/README.md index e8931b8..68368a1 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ If you pass the connection it's up to you to reconnect in case the connection dr #### API reference The complete API reference is hosted [here](https://binary-com.github.io/python-deriv-api/) -Examples [here](https://github.com/binary-com/python-deriv-api/examples) +Examples [here](https://github.com/binary-com/python-deriv-api/tree/master/examples) # Development ```