Skip to content

Commit

Permalink
Merge pull request #57 from Caltech-IPAC/FIREFLY-1440-cd-gh-action
Browse files Browse the repository at this point in the history
FIREFLY-1440: Set up continuous deployment for documentation website
  • Loading branch information
jaladh-singhal authored Mar 28, 2024
2 parents 5326a43 + 89f356c commit 4428b5c
Show file tree
Hide file tree
Showing 24 changed files with 290 additions and 121 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: "Publish documentation"
on:
push:
branches:
- master

workflow_dispatch: # Manual trigger

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'

- name: Create environment
run: |
pip install --upgrade pip
python -m venv .venv
source .venv/bin/activate
- name: Install dependencies
run: pip install -r requirements.txt

- name: Install package
run: pip install -e .

- name: Build docs
run: |
cd docs
make clean
make html
- name: Deploy docs
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_build/html

7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ instance/

# Sphinx documentation
docs/_build/
docs/api/

# PyBuilder
target/
Expand All @@ -81,13 +82,13 @@ celerybeat-schedule
# virtualenv
venv/
ENV/
.venv/

# Spyder project settings
.spyderproject

# Rope project settings
.ropeproject

doc/_build/
doc/py-api/

# MacOS
.DS_Store
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ repository is located at http://github.com/Caltech-IPAC/firefly.
Standalone Firefly servers may be obtained from
[this Dockerhub repository](https://hub.docker.com/r/ipac/firefly/).

For detailed explanation on the usage, see [the online documentation](https://firefly-client.lsst.io),
or [the documentation source file](doc/index.rst). Following is a very simple example:
For detailed explanation on the usage, see [the online documentation](https://caltech-ipac.github.io/firefly_client). Following is a very simple example:

```
from firefly_client import FireflyClient
Expand Down
64 changes: 0 additions & 64 deletions doc/Makefile

This file was deleted.

Empty file removed doc/_static/Readme.md
Empty file.
18 changes: 0 additions & 18 deletions doc/conf.py

This file was deleted.

20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
18 changes: 18 additions & 0 deletions docs/_static/custom-icon.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 54 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'firefly_client'
copyright = '2024, Caltech/IPAC Firefly Developers'
author = 'Caltech/IPAC Firefly Developers'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = [
'sphinx_automodapi.automodapi',
'myst_parser'
]

templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']


# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = 'pydata_sphinx_theme'
html_static_path = ['_static']
html_js_files = ["custom-icon.js"]

html_last_updated_fmt = ''

# See https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/layout.html
html_theme_options = {
"icon_links": [
{
"name": "GitHub",
"url": "https://github.com/Caltech-IPAC/firefly_client",
"icon": "fa-brands fa-github",
},
{
"name": "PyPI",
"url": "https://pypi.org/project/firefly-client",
"icon": "fa-custom fa-pypi",
},
],
"footer_start": ["copyright", "last-updated"],
"footer_end": ["sphinx-version", "theme-version"],
}


# -- Options for extensions -------------------------------------------------
myst_heading_anchors = 3
31 changes: 31 additions & 0 deletions docs/development/guide.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#################
Local development
#################

Get latest source from ``master`` branch at https://github.com/Caltech-IPAC/firefly_client.


Environment Setup
-----------------

TBD


Building documentation
----------------------

Make sure you have the virtual/conda environment activated and documentation
dependencies installed in that environment.

Then do:

.. code-block:: shell
cd docs
make clean && make html
Open ``docs/_build/html/index.html`` in your browser to see the documentation
website.

Each time you make a change in documentation source, build it using
above command and reload the above file in browser.
11 changes: 11 additions & 0 deletions docs/development/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
###############
Developer Guide
###############


.. toctree::
:maxdepth: 2

guide
new-release-procedure.md

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## How to create a firefly_client release
# Making a release

### Procedure
## Procedure
1. To push a new release you must be a maintainer in pypi ([see pypi below](#pypi))
2. Bump version in setup.py (this step is might be done in the PR)
3. Clean out old distribution
Expand Down Expand Up @@ -34,21 +34,21 @@
11. Make is release with github, using the tag above
- https://github.com/Caltech-IPAC/firefly_client/releases

### PYPI
## PYPI

- https://pypi.org/project/firefly-client/
- Currently two maintainers
- Testing site: https://test.pypi.org/project/firefly-client/

### Optional Test installation
## Optional Test installation

1. To create a test release you must be a mainainer on testpypi
2. Create the distribution (see above)
3. `twine upload --repository-url https://test.pypi.org/legacy/ dist/*`
4. `pip uninstall firefly_client`
5. `pip install --verbose --index-url https://testpypi.python.org/pypi firefly_client`

### Conda and conda-forge
## Conda and conda-forge

Anytime the version tag is updated conda-forge it set up to do a pull and add `firefly_client` to its distribution.

Expand Down
Loading

0 comments on commit 4428b5c

Please sign in to comment.