Skip to content

Commit

Permalink
Add docs workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
stinodego committed Aug 28, 2023
1 parent 8cc98a5 commit 7f7a550
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 104 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/docs-global.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Build Polars documentation

on:
pull_request:
push:
branches:
- main

permissions:
contents: write

defaults:
run:
shell: bash
working-directory: docs

jobs:
test-python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'

- run: pip install -r requirements.txt

- name: Install graphviz
# uses: ts-graphviz/setup-graphviz@v1
run: sudo apt-get install -y graphviz

- run: find docs/src/ -name "*.py" | xargs -n 1 sh -c 'python $0 || exit 255'

black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- run: pip install black==23.3.0
- run: black --check .

markdown-link-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: gaurav-nelson/github-action-markdown-link-check@v1

deploy:
needs: [test-python, black, rome, test-node, markdown-link-check]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.11

- run: pip install -r requirements.txt

- run: sudo apt-get install -y graphviz

- run: mkdocs gh-deploy --force
4 changes: 2 additions & 2 deletions docs/Contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ We use GitHub to host code, to track issues and feature requests, as well as acc
1. Fork the [repo](https://github.com/pola-rs/polars-book.git) in your own GitHub account.
1. Clone your own version of the repo locally, and `cd` into it.
1. Add the upstream remote with `git remote add upstream https://github.com/pola-rs/polars-book.git`
1. All branches should derive from `master`, you can `git checkout -b <YOUR-BRANCH>` and write away.
1. All branches should derive from `main`, you can `git checkout -b <YOUR-BRANCH>` and write away.
1. Commit/push to your own repo.
1. Open a pull request as you would usually do, making sure the "base repository" is the upstream repo (`master` branch) and the "head repository" your own (`<YOUR-BRANCH>` branch).
1. Open a pull request as you would usually do, making sure the "base repository" is the upstream repo (`main` branch) and the "head repository" your own (`<YOUR-BRANCH>` branch).

To update your own repo with code pushed on the upstream repo:

Expand Down
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ In order to serve the books run `make serve`. This will run all the python examp

## Deployment

Deployment of the book is done using Github Pages and Github Workflows. The book is automatically deployed on each push to master / main branch. There are a number of checks in the CI pipeline to avoid non-working examples:
Deployment of the book is done using Github Pages and Github Workflows. The book is automatically deployed on each push to main branch. There are a number of checks in the CI pipeline to avoid non-working examples:

- Run all python examples, fail on any errors
- Run all node examples, fail on any errors
- Check all links in markdown
- Run black formatter
- Run black formatter
2 changes: 1 addition & 1 deletion docs/docs/snippets/under_construction.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
!!! warning ":construction: Under Construction :construction: "

This section is still under development. Want to help out? Consider contributing and making a [pull request](https://github.com/pola-rs/polars-book) to our repository.
Please read our [Contribution Guidelines](https://github.com/pola-rs/polars-book/blob/master/CONTRIBUTING.md) on how to proceed.
Please read our [Contribution Guidelines](https://github.com/pola-rs/polars-book/blob/main/CONTRIBUTING.md) on how to proceed.
4 changes: 2 additions & 2 deletions docs/docs/user-guide/misc/contributing.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Contributing

See the [`CONTRIBUTING.md`](https://github.com/pola-rs/polars/blob/master/CONTRIBUTING.md) if you would like to contribute to the `Polars` project.
See the [`CONTRIBUTING.md`](https://github.com/pola-rs/polars/blob/main/CONTRIBUTING.md) if you would like to contribute to the `Polars` project.

If you're new to this we recommend starting out with contributing examples to the Python API documentation. The Python API docs are generated from the docstrings of the Python wrapper located in `polars/py-polars`.

Here is an example [commit](https://github.com/pola-rs/polars/pull/3567/commits/5db9e335f3f2777dd1d6f80df765c6bca8f307b0) that adds a docstring.

If you spot any gaps in this User Guide you can submit fixes to the [`pola-rs/polars-book`](https://github.com/pola-rs/polars-book) repo.

Happy hunting!
Happy hunting!
73 changes: 0 additions & 73 deletions docs/workflows/ci.yaml

This file was deleted.

24 changes: 0 additions & 24 deletions docs/workflows/deploy.yaml

This file was deleted.

0 comments on commit 7f7a550

Please sign in to comment.