Skip to content

Commit

Permalink
DOC add deployment action + update readme (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
joaopfonseca committed Feb 16, 2024
1 parent f2e1245 commit 3114643
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 6 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Documentation

on:
push:
branches: [ main ]

workflow_dispatch:

jobs:
# Build job
build:
name: Build
# At a minimum this job should upload artifacts using actions/upload-pages-artifact
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.12
architecture: x64

- name: Install
run: |
# NOTE: pip, setuptools and wheel should be included with any python
# installation. It's being installed/upgraded here because the
# setup-python action is not including setuptools with Python 3.12
pip install --upgrade pip setuptools wheel
pip install .[docs]
- name: Build Docs
run: |
cd doc
make html
- name: Archive artifact
run: |
tar \
--dereference --hard-dereference \
--directory "$INPUT_PATH" \
-cvf "$RUNNER_TEMP/artifact.tar" \
--exclude=.git \
--exclude=.github \
.
env:
INPUT_PATH: "doc/_build/html/"

- name: Upload artifact
id: upload-artifact
uses: actions/upload-artifact@v4
with:
name: github-pages
path: ${{ runner.temp }}/artifact.tar
if-no-files-found: error

# Deploy job
deploy:
name: Deploy
# Add a dependency to the build job
needs: build

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

# Deploy to the github-pages environment
environment:
name: ShaRP
url: ${{ steps.deployment.outputs.page_url }}

# Specify runner + deployment step
runs-on: ubuntu-latest
steps:

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,13 @@ Some functions require Matplotlib (>= 2.2.3) for plotting.

### User Installation

**NOTE: DO NOT USE THIS METHOD. IT IS NOT IMPLEMENTED YET**

The easiest way to install ml-research is using ``pip`` :

pip install -U sharp
pip install -U xai-sharp

Or ``conda`` :

conda install -c conda-forge sharp
conda install -c conda-forge xai-sharp

The documentation includes more detailed [installation
instructions](https://sharp.readthedocs.io/en/latest/getting-started.html).
Expand All @@ -37,7 +35,7 @@ The following commands should allow you to setup the development version of the
project with minimal effort:

# Clone the project.
git clone https://github.com/joaopfonseca/sharp.git
git clone https://github.com/DataResponsibly/sharp.git
cd sharp

# Create and activate an environment
Expand Down
2 changes: 1 addition & 1 deletion sharp/_min_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"numpy": (NUMPY_MIN_VERSION, "install"),
"pandas": (PANDAS_MIN_VERSION, "install"),
"scikit-learn": (SKLEARN_MIN_VERSION, "install"),
"matplotlib": (MATPLOTLIB_MIN_VERSION, "optional"),
"matplotlib": (MATPLOTLIB_MIN_VERSION, "optional, docs"),
# "ml-research": ("0.4.2", "optional"),
"pytest-cov": ("3.0.0", "tests"),
"flake8": ("3.8.2", "tests"),
Expand Down

0 comments on commit 3114643

Please sign in to comment.