Skip to content

Commit

Permalink
feat(ci): Update docs and PyPI deployment (#9)
Browse files Browse the repository at this point in the history
* feat(docs): Update navigation tabs for new deployment

* feat(docs): Update website color for new deployment

* feat(docs): Update objects.inv link for new deployment

* feat(docs): More explicit URLs

* feat(ci): Add action for publishing PyPI package and docs

* feat(docs): Update site name for new deployment
  • Loading branch information
cpvannier authored Feb 27, 2024
1 parent 2701983 commit 257d5ce
Show file tree
Hide file tree
Showing 11 changed files with 104 additions and 34 deletions.
86 changes: 86 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# @Copyright: CEA-LIST/DIASI/SIALV/LVA (2023)
# @Author: CEA-LIST/DIASI/SIALV/LVA <[email protected]>
# @License: CECILL-C
#
# This software is a collaborative computer program whose purpose is to
# generate and explore labeled data for computer vision applications.
# This software is governed by the CeCILL-C license under French law and
# abiding by the rules of distribution of free software. You can use,
# modify and/ or redistribute the software under the terms of the CeCILL-C
# license as circulated by CEA, CNRS and INRIA at the following URL
#
# http://www.cecill.info

# This workflow will publish the new version of Pixano Inference to PyPI when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Publish

on:
release:
types: [published]

permissions:
contents: write

jobs:
deploy_pypi:
name: Build and publish to PyPI
runs-on: ubuntu-latest
permissions:
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install hatch
- name: Build package
run: hatch build

- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1

deploy_docs:
name: Publish documentation website
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Configure git credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Create cache_id for key creation
run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV

- name: Create cache key with cache_id
uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- name: Install dependencies
run: pip install .[documentation]

- name: Publish documentation website
run: mkdocs gh-deploy --force
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/assets/extra.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
:root {
--md-primary-fg-color: #1e7736;
--md-primary-fg-color: #771e5f;
}
2 changes: 1 addition & 1 deletion docs/gen_ref_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import mkdocs_gen_files

SRC_PATH = "pixano_inference"
REF_PATH = "code"
REF_PATH = "api_reference"
IGNORED_FILES = ["__init__.py", "__version__.py"]

nav = mkdocs_gen_files.Nav()
Expand Down
5 changes: 5 additions & 0 deletions docs/getting_started/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Getting started with Pixano Inference

- [Installing Pixano Inference](installing_pixano_inference.md)
- [Using pre-annotation models](pre_annotation.md)
- [Using interactive annotation models](interactive_annotation.md)
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 0 additions & 14 deletions docs/index.md

This file was deleted.

7 changes: 0 additions & 7 deletions docs/user/index.md

This file was deleted.

22 changes: 11 additions & 11 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
site_name: Pixano Inference Documentation
site_name: Pixano Documentation
theme:
name: material
logo: assets/pixano_white.png
Expand Down Expand Up @@ -68,7 +68,7 @@ plugins:
- https://arrow.apache.org/docs/objects.inv
- https://docs.pydantic.dev/2.4/objects.inv
- https://ipython.readthedocs.io/en/8.13.2/objects.inv
- https://pixano.github.io/objects.inv
- https://pixano.github.io/pixano/objects.inv
- https://pytorch.org/docs/master/objects.inv
- url: https://github.com/GPflow/tensorflow-intersphinx/raw/master/tf2_py_objects.inv
base_url: https://www.tensorflow.org/api_docs/python
Expand All @@ -87,14 +87,14 @@ plugins:
heading_level: 1

nav:
- "Home": index.md
- "Home": https://pixano.github.io/

- "Getting started":
- user/index.md
- "Installing Pixano Inference": user/install.md
- "Pre-annotation": user/pre_annotation.md
- "Interactive annotation": user/interactive_annotation.md
- "Pixano": https://pixano.github.io/pixano/

- "API reference": code/

- "Pixano": https://pixano.github.io
- "Pixano Inference":
- "Getting started":
- getting_started/index.md
- "Installing Pixano Inference": getting_started/installing_pixano_inference.md
- "Pre-annotation": getting_started/pre_annotation.md
- "Interactive annotation": getting_started/interactive_annotation.md
- "API reference": api_reference/

0 comments on commit 257d5ce

Please sign in to comment.