Skip to content

Commit

Permalink
docs: add initial setup (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
vascoalramos authored Feb 22, 2023
1 parent e15b056 commit 975c8cd
Show file tree
Hide file tree
Showing 15 changed files with 171 additions and 15 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Publish Documentation



on:
push:
paths:
- docs/**
- mkdocs.yml
branches:
- main
release:
types:
- released



jobs:
prepare:
name: Get Current version
runs-on: ubuntu-22.04

outputs:
version: ${{ steps.version.outputs.value }}

steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.ACCESS_TOKEN }}

- name: Find Latest Tag
id: latest_tag
uses: oprypin/[email protected]
with:
repository: ${{ github.repository }}
regex: '^\d+\.\d+\.\d+'
releases-only: true

- name: Extract major and minor version
id: version
run: |
echo "value=`echo ${{ steps.latest_tag.outputs.tag }} | sed -r 's|([0-9]+.[0-9]+).*|\1|g'`" >> $GITHUB_OUTPUT
publish-docs:
name: Publish Docs
runs-on: ubuntu-22.04

needs:
- prepare

steps:
- uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Cache pip dependencies
id: cache
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}

- name: Install doc dependencies
run: |
python -m pip install --upgrade pip
make install-doc
- name: Publish
run: make publish-docs version=${{ needs.prepare.outputs.version }}
2 changes: 2 additions & 0 deletions .github/workflows/merge-main.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
name: Merge Main



on:
push:
branches:
- main



jobs:
prepare:
name: Calculate Version and Build Number
Expand Down
12 changes: 0 additions & 12 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,6 @@ on:


jobs:
cancel_previous:
name: 'Cancel Previous Runs'
runs-on: ubuntu-22.04
timeout-minutes: 3

steps:
- uses: ydataai/[email protected]
with:
ignore_sha: true
access_token: ${{ secrets.ACCESS_TOKEN }}


validate:
name: Validate
runs-on: ubuntu-22.04
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
name: built-artifacts
path: dist/


upload-assets:
name: Upload Assets to Release
runs-on: ubuntu-22.04
Expand All @@ -69,6 +70,7 @@ jobs:
repo-token: ${{ secrets.ACCESS_TOKEN }}
release-tag: ${{ needs.package.outputs.version }}


publish-pypi:
name: Publish packages to PyPi
runs-on: ubuntu-22.04
Expand Down
12 changes: 9 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ endif
venv3: ### Creates a virtual environment for this project
test -d $(VENV) || $(PYTHON) -m venv $(VENV) && source $(VENV)/bin/activate
$(PIP) install --upgrade pip
$(PIP) install -e ".[dev,test]"
install-all

clean: clean-build clean-pyc ### Cleans artifacts

Expand All @@ -38,14 +38,20 @@ install: ### Installs regular dependencies
install-dev: ### Installs regular and dev dependencies
$(PIP) install -e ".[dev]"

install-doc: ### Installs regular and doc dependencies
$(PIP) install -e ".[doc]"

install-test: ### Installs regular and test dependencies
$(PIP) install -e ".[dev]"

install-all: ### Installs regular, dev and test dependencies
$(PIP) install -e ".[dev,test]"
install-all: ### Installs regular, dev, doc, and test dependencies
$(PIP) install -e ".[dev,doc,test]"

package:
rm -rf build dist
echo "$(version)" > VERSION
flit build
twine check dist/*

publish-docs:
mike deploy --push --update-aliases $(version) latest
16 changes: 16 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# YData SDK Documentation

Installing the documentation dependencies (one-time step):
```bash
pip install -e ".[doc]"
```

Build the doc for deployment:
```bash
mkdocs build
```

To build and serve locally:
```bash
mkdocs serve
```
Empty file.
Empty file.
Empty file.
17 changes: 17 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Welcome to MkDocs

For full documentation visit [mkdocs.org](https://www.mkdocs.org).

## Commands

* `mkdocs new [dir-name]` - Create a new project.
* `mkdocs serve` - Start the live-reloading docs server.
* `mkdocs build` - Build the documentation site.
* `mkdocs -h` - Print help message and exit.

## Project layout

mkdocs.yml # The configuration file.
docs/
index.md # The documentation homepage.
... # Other markdown pages, images and other files.
Empty file added docs/reference/api/index.md
Empty file.
Empty file added docs/reference/changelog.md
Empty file.
1 change: 1 addition & 0 deletions docs/support/help-troubleshooting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Help & Troubleshooting
46 changes: 46 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
site_name: YData SDK

repo_name: ydataai/ydata-sdk
repo_url: https://github.com/ydataai/ydata-sdk

theme:
name: material
language: en
palette:
- media: "(prefers-color-scheme: light)"
scheme: default
primary: blue grey
accent: deep orange
toggle:
icon: material/toggle-switch-off-outline
name: Switch to dark mode
- media: "(prefers-color-scheme: dark)"
primary: blue grey
accent: deep orange
scheme: slate
toggle:
icon: material/toggle-switch
name: Switch to light mode

nav:
- Getting started:
- Overview: 'index.md'
- Installation: 'getting-started/installation.md'
- Quickstart: 'getting-started/quickstart.md'
- Examples: 'getting-started/examples.md'
- Support:
- Help & Troubleshooting: 'support/help-troubleshooting.md'
- Contribution Guidelines: 'support/help-troubleshooting.md'
- Reference:
- Changelog: 'reference/changelog.md'
- API:
- Overview: 'reference/api/overview.md'
- GAN: 'reference/api/synthesizers/gan.md'
- Regular:
- CGAN: 'reference/api/synthesizers/cgan.md'


extra:
version:
provider: mike
generator: false
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ dev = [
"flit==3.8.0",
"pylint==2.15.10",
]
doc = [
"mkdocs>=1.4.2,<2.0.0",
"mkdocs-material>=9.0.12,<10.0.0",
"mike>=1.1.2,<2.0.0",
]
test = [
"pytest==6.2.5",
"pytest-bdd==4.0.*",
Expand Down

0 comments on commit 975c8cd

Please sign in to comment.