Skip to content

Commit

Permalink
Docs workflow test (#198)
Browse files Browse the repository at this point in the history
* Docs workflow test

* Update python versions and change conda env

* Updated readme and added dep to env.yml

* Add css config for footer placement
  • Loading branch information
chkim-usgs authored Sep 7, 2023
1 parent 98206cc commit f2414a2
Show file tree
Hide file tree
Showing 11 changed files with 336 additions and 228 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/aws_doc_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: aws-doc-deploy

on:
workflow_run:
workflows: ["Pull-Request-CI"]
branches: [main]
types:
- completed

jobs:
deploy:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
with:
submodules: true
fetch-depth: 0
- uses: conda-incubator/setup-miniconda@3b0f2504dd76ef23b6d31f291f4913fb60ab5ff3
with:
miniconda-version: "latest"
activate-environment: plio
environment-file: environment_docs.yml
auto-activate-base: false
auto-update-conda: true

- name: Check doc build environment
run: |
conda list
- name: Build Docs
run: |
cd docs
sphinx-build -b html . public
- name: Set AWS credentials for upload
uses: aws-actions/configure-aws-credentials@0e613a0980cbf65ed5b322eb7a1e075d28913a83
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2

- name: Upload to S3
working-directory: docs
run: aws s3 sync --delete public s3://asc-public-docs/plio
33 changes: 29 additions & 4 deletions .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: Pull-Request-CI
on:
pull_request:
branches:
- master
- main
push:
branches:
- master
- main

jobs:
Build-and-Test:
Expand All @@ -15,7 +15,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.6", "3.7", "3.8"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
defaults:
run:
shell: bash -l {0}
Expand All @@ -30,7 +30,7 @@ jobs:
use-mamba: true
channels: conda-forge, defaults
channel-priority: strict
activate-environment: autocnet
activate-environment: plio
environment-file: environment.yml
python-version: ${{ matrix.python-version }}
- name: Check build environment
Expand All @@ -49,3 +49,28 @@ jobs:
fail_ci_if_error: true
verbose: true
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.8'

Build-Docs:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
with:
submodules: true
fetch-depth: 0
- uses: conda-incubator/setup-miniconda@3b0f2504dd76ef23b6d31f291f4913fb60ab5ff3
with:
miniconda-version: "latest"
activate-environment: plio
environment-file: environment_docs.yml
auto-activate-base: false
auto-update-conda: true
- name: Check doc build environment
run: |
conda list
- name: Build Docs
run: |
cd docs
sphinx-build -b html . public
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,26 @@ To install the development version:
```
conda install -c usgs-astrogeology/label/dev plio
```

Building documentation
======================

Create the `plio` conda environment:

```
conda env create -f environment.yml
```

Activate the conda environment:

```
conda activate plio
```

Go into the `docs` directory and build the sphinx docs with:

```
sphinx-build -b html . public
```

This outputs the generated documentation into `docs/public` where you can open `public/index.html` in a browser to view PLIO docs locally.
221 changes: 0 additions & 221 deletions docs/_templates/ganalytics_layout.html

This file was deleted.

11 changes: 9 additions & 2 deletions docs/_templates/layout.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
{% extends "ganalytics_layout.html" %}
{% extends '!layout.html' %}

{% block header %}
{% include "usgsheader.html" %}
{{ super() }}
{% endblock %}

{% block rootrellink %}
<li><a href="{{ pathto('index') }}">home</a>|&nbsp;</li>
<li><a href="{{ pathto('search') }}">search</a>|&nbsp;</li>
<li><a href="{{ pathto('contents') }}">documentation </a> &raquo;</li>
<li><a href="#documentation">documentation </a> &raquo;</li>
{% endblock %}


Expand All @@ -17,3 +21,6 @@
{% block sidebar1 %}{% endblock %}
{% block sidebar2 %}{{ sidebar() }}{% endblock %}

{% block footer %}
{% include "usgsfooter.html" %}
{% endblock %}
Loading

0 comments on commit f2414a2

Please sign in to comment.