Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: dartdoc + mkdocs #5717

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 35 additions & 22 deletions .github/workflows/dartdoc.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
name: GitHub Pages Deploy Action
on:
push:
branches:
- "develop"
#- "dartdoc-smoothie"
jobs:
deploy-pages:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./packages/smooth_app
steps:
name: GitHub Pages Deploy Action
on:
push:
branches:
- "develop"
jobs:
deploy-pages:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./packages/smooth_app
steps:

- name: Chekout code
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Flutter
Expand All @@ -26,11 +25,25 @@
channel: stable
flutter-version: 2.5.0

- name: Run Dartdoc
run: pub global activate dartdoc && dartdoc
- name: Run Dartdoc
run: pub global activate dartdoc && dartdoc

- name: Deploy API documentation to Github Pages
uses: JamesIves/[email protected]
with:
BRANCH: gh-pages
FOLDER: packages/smooth_app/doc/api/
- name: Install mkdocs and mkdocs-material
run: |
python -m pip install --upgrade pip
pip install mkdocs mkdocs-material

- name: Build documentation using mkdocs
run: mkdocs build

- name: Deploy smooth_app documentation to Github Pages
uses: JamesIves/[email protected]
with:
BRANCH: gh-pages
FOLDER: packages/smooth_app/docs/

- name: Deploy scanner documentation to Github Pages
uses: JamesIves/[email protected]
with:
BRANCH: gh-pages
FOLDER: packages/smooth_app/docs/
36 changes: 36 additions & 0 deletions packages/smooth_app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,39 @@ Submodule containing all the logic of the Smoothie app.
In the future, it will receive as parameters:
- a barcode decoding algorithm
- how to manage the review on the app store

## Documentation

We use `mkdocs` for our documentation. `mkdocs` is a static site generator that's geared towards project documentation. It is written in Python.

### How to use `mkdocs`

1. Install `mkdocs`:
```sh
pip install mkdocs mkdocs-material
```

2. Serve the documentation locally:
```sh
mkdocs serve
```

This will start a local server at `http://127.0.0.1:8000/` where you can view the documentation.

3. Build the documentation:
```sh
mkdocs build
```

This will generate a static site in the `site` directory.

### Deploying the documentation

We use GitHub Pages to host our documentation. The deployment is handled automatically by a GitHub Actions workflow.

To manually deploy the documentation, you can use the following command:
```sh
mkdocs gh-deploy
```

This will build the documentation and push it to the `gh-pages` branch of the repository.
22 changes: 22 additions & 0 deletions packages/smooth_app/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
site_name: Open Food Facts mobile app
docs_dir: doc
repo_url: https://github.com/openfoodfacts/smooth-app
edit_uri: blob/develop/docs/
site_dir: gh_pages

theme:
name: material
palette:
primary: beige
text: black
logo: assets/app/logo_text_black.svg

markdown_extensions:
- footnotes
- mdx_truly_sane_lists
- pymdownx.highlight
- pymdownx.superfences

plugins:
- awesome-pages
- search
Loading