Skip to content
Snippets Groups Projects
Unverified Commit f2414a22 authored by Christine Kim's avatar Christine Kim Committed by GitHub
Browse files

Docs workflow test (#198)

* Docs workflow test

* Update python versions and change conda env

* Updated readme and added dep to env.yml

* Add css config for footer placement
parent 98206cc3
No related branches found
No related tags found
No related merge requests found
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
\ No newline at end of file
...@@ -3,10 +3,10 @@ name: Pull-Request-CI ...@@ -3,10 +3,10 @@ name: Pull-Request-CI
on: on:
pull_request: pull_request:
branches: branches:
- master - main
push: push:
branches: branches:
- master - main
jobs: jobs:
Build-and-Test: Build-and-Test:
...@@ -15,7 +15,7 @@ jobs: ...@@ -15,7 +15,7 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest, macos-latest] os: [ubuntu-latest, macos-latest]
python-version: ["3.6", "3.7", "3.8"] python-version: ["3.8", "3.9", "3.10", "3.11"]
defaults: defaults:
run: run:
shell: bash -l {0} shell: bash -l {0}
...@@ -30,7 +30,7 @@ jobs: ...@@ -30,7 +30,7 @@ jobs:
use-mamba: true use-mamba: true
channels: conda-forge, defaults channels: conda-forge, defaults
channel-priority: strict channel-priority: strict
activate-environment: autocnet activate-environment: plio
environment-file: environment.yml environment-file: environment.yml
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
- name: Check build environment - name: Check build environment
...@@ -49,3 +49,28 @@ jobs: ...@@ -49,3 +49,28 @@ jobs:
fail_ci_if_error: true fail_ci_if_error: true
verbose: true verbose: true
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.8' 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
...@@ -64,3 +64,26 @@ To install the development version: ...@@ -64,3 +64,26 @@ To install the development version:
``` ```
conda install -c usgs-astrogeology/label/dev plio 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.
\ No newline at end of file
{%- block doctype -%}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
{%- endblock %}
{%- set reldelim1 = reldelim1 is not defined and ' &raquo;' or reldelim1 %}
{%- set reldelim2 = reldelim2 is not defined and ' |' or reldelim2 %}
{%- macro relbar() %}
<div class="related">
<h3>{{ _('Navigation') }}</h3>
<ul>
{%- for rellink in rellinks %}
<li class="right" {% if loop.first %}style="margin-right: 10px"{% endif %}>
<a href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags }}"
{{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a>
{%- if not loop.first %}{{ reldelim2 }}{% endif %}</li>
{%- endfor %}
{%- block rootrellink %}
<li><a href="{{ pathto(master_doc) }}">{{ shorttitle|e }}</a>{{ reldelim1 }}</li>
{%- endblock %}
{%- for parent in parents %}
<li><a href="{{ parent.link|e }}" {% if loop.last %}{{ accesskey("U") }}{% endif %}>{{ parent.title }}</a>{{ reldelim1 }}</li>
{%- endfor %}
{%- block relbaritems %} {% endblock %}
</ul>
</div>
{%- endmacro %}
{%- macro sidebar() %}
{%- if not embedded %}{% if not theme_nosidebar|tobool %}
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
{%- block sidebarlogo %}
{%- if logo %}
<p class="logo"><a href="{{ pathto(master_doc) }}">
<img class="logo" src="{{ pathto('_static/' + logo, 1) }}" alt="Logo"/>
</a></p>
{%- endif %}
{%- endblock %}
{%- block sidebartoc %}
{%- if display_toc %}
<h3><a href="{{ pathto(master_doc) }}">{{ _('Table Of Contents') }}</a></h3>
{{ toc }}
{%- endif %}
{%- endblock %}
{%- block sidebarrel %}
{%- if prev %}
<h4>{{ _('Previous topic') }}</h4>
<p class="topless"><a href="{{ prev.link|e }}"
title="{{ _('previous chapter') }}">{{ prev.title }}</a></p>
{%- endif %}
{%- if next %}
<h4>{{ _('Next topic') }}</h4>
<p class="topless"><a href="{{ next.link|e }}"
title="{{ _('next chapter') }}">{{ next.title }}</a></p>
{%- endif %}
{%- endblock %}
{%- block sidebarsourcelink %}
{%- if show_source and has_source and sourcename %}
<h3>{{ _('This Page') }}</h3>
<ul class="this-page-menu">
<li><a href="{{ pathto('_sources/' + sourcename, true)|e }}"
rel="nofollow">{{ _('Show Source') }}</a></li>
</ul>
{%- endif %}
{%- endblock %}
{%- if customsidebar %}
{% include customsidebar %}
{%- endif %}
{%- block sidebarsearch %}
{%- if pagename != "search" %}
<div>
<h3>Releases</h3>
<ul class="last simple">
<li><a class="reference external" href="https://anaconda.org/jlaura/plio">Binary 0.1.0 release</a></li>
<li><a class="reference external" href="http://github.com/USGS-Astrogeology/plio">Development 0.1.0dev</a></li>
</ul>
</div>
<div id="searchbox" style="display: none">
<h3>{{ _('Quick search') }}</h3>
<form class="search" action="{{ pathto('search') }}" method="get">
<input type="text" name="q" size="18" />
<input type="submit" value="{{ _('Go') }}" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
{{ _('Enter search terms or a module, class or function name.') }}
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
{%- endif %}
{%- endblock %}
</div>
</div>
{%- endif %}{% endif %}
{%- endmacro %}
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
{{ metatags }}
{%- if not embedded %}
{%- set titlesuffix = " &mdash; "|safe + docstitle|e %}
{%- else %}
{%- set titlesuffix = "" %}
{%- endif %}
<title>{{ title|striptags }}{{ titlesuffix }}</title>
<link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" />
<link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" />
{%- if not embedded %}
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '{{ pathto("", 1) }}',
VERSION: '{{ release|e }}',
COLLAPSE_MODINDEX: false,
FILE_SUFFIX: '{{ file_suffix }}',
HAS_SOURCE: {{ has_source|lower }}
};
</script>
{%- for scriptfile in script_files %}
<script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script>
{%- endfor %}
{%- if use_opensearch %}
<link rel="search" type="application/opensearchdescription+xml"
title="{% trans docstitle=docstitle|e %}Search within {{ docstitle }}{% endtrans %}"
href="{{ pathto('_static/opensearch.xml', 1) }}"/>
{%- endif %}
{%- if favicon %}
<link rel="shortcut icon" href="{{ pathto('_static/' + favicon, 1) }}"/>
{%- endif %}
{%- endif %}
{%- block linktags %}
{%- if hasdoc('about') %}
<link rel="author" title="{{ _('About these documents') }}" href="{{ pathto('about') }}" />
{%- endif %}
{%- if hasdoc('genindex') %}
<link rel="index" title="{{ _('Index') }}" href="{{ pathto('genindex') }}" />
{%- endif %}
{%- if hasdoc('search') %}
<link rel="search" title="{{ _('Search') }}" href="{{ pathto('search') }}" />
{%- endif %}
{%- if hasdoc('copyright') %}
<link rel="copyright" title="{{ _('Copyright') }}" href="{{ pathto('copyright') }}" />
{%- endif %}
<link rel="top" title="{{ docstitle|e }}" href="{{ pathto('index') }}" />
{%- if parents %}
<link rel="up" title="{{ parents[-1].title|striptags }}" href="{{ parents[-1].link|e }}" />
{%- endif %}
{%- if next %}
<link rel="next" title="{{ next.title|striptags }}" href="{{ next.link|e }}" />
{%- endif %}
{%- if prev %}
<link rel="prev" title="{{ prev.title|striptags }}" href="{{ prev.link|e }}" />
{%- endif %}
{%- endblock %}
{%- block extrahead %} {% endblock %}
</head>
<body>
{%- block header %}{% endblock %}
{%- block relbar1 %}{{ relbar() }}{% endblock %}
{%- block sidebar1 %} {# possible location for sidebar #} {% endblock %}
<div class="document">
{%- block document %}
<div class="documentwrapper">
{%- if not embedded %}{% if not theme_nosidebar|tobool %}
<div class="bodywrapper">
{%- endif %}{% endif %}
<div class="body">
{% block body %} {% endblock %}
</div>
{%- if not embedded %}{% if not theme_nosidebar|tobool %}
</div>
{%- endif %}{% endif %}
</div>
{%- endblock %}
{%- block sidebar2 %}{{ sidebar() }}{% endblock %}
<div class="clearer"></div>
</div>
{%- block relbar2 %}{{ relbar() }}{% endblock %}
{%- block footer %}
<div class="footer">
{%- if hasdoc('copyright') %}
{% trans path=pathto('copyright'), copyright=copyright|e %}&copy; <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %}
{%- else %}
{% trans copyright=copyright|e %}&copy; Copyright {{ copyright }}.{% endtrans %}
{%- endif %}
{%- if last_updated %}
{% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}
{%- endif %}
{%- if show_sphinx %}
{% trans sphinx_version=sphinx_version|e %}Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %}
{%- endif %}
</div>
{%- endblock %}
<!--Begin Google Analytics Code -->
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<!--End Google Analytics Code -->
</body>
</html>
{% extends "ganalytics_layout.html" %} {% extends '!layout.html' %}
{% block header %}
{% include "usgsheader.html" %}
{{ super() }}
{% endblock %}
{% block rootrellink %} {% block rootrellink %}
<li><a href="{{ pathto('index') }}">home</a>|&nbsp;</li> <li><a href="{{ pathto('index') }}">home</a>|&nbsp;</li>
<li><a href="{{ pathto('search') }}">search</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 %} {% endblock %}
...@@ -17,3 +21,6 @@ ...@@ -17,3 +21,6 @@
{% block sidebar1 %}{% endblock %} {% block sidebar1 %}{% endblock %}
{% block sidebar2 %}{{ sidebar() }}{% endblock %} {% block sidebar2 %}{{ sidebar() }}{% endblock %}
{% block footer %}
{% include "usgsfooter.html" %}
{% endblock %}
<footer class="footer">
<div class="tmp-container">
<div class="footer-doi">
<ul class="menu nav">
<li class="first leaf menu-links menu-level-1"><a href="https://www.doi.gov/privacy">DOI Privacy Policy</a></li>
<li class="leaf menu-links menu-level-1"><a href="https://www.usgs.gov/policies-and-notices">Legal</a></li>
<li class="leaf menu-links menu-level-1"><a href="https://www.usgs.gov/accessibility-and-us-geological-survey">Accessibility</a></li>
<li class="leaf menu-links menu-level-1"><a href="https://www.usgs.gov/sitemap">Site Map</a></li>
<li class="last leaf menu-links menu-level-1"><a href="https://answers.usgs.gov/">Contact USGS</a></li>
</ul>
</div>
<hr>
<div class="footer-doi">
<ul class="menu nav">
<li class="first leaf menu-links menu-level-1"><a href="https://www.doi.gov/">U.S. Department of the Interior</a></li>
<li class="leaf menu-links menu-level-1"><a href="https://www.doioig.gov/">DOI Inspector General</a></li>
<li class="leaf menu-links menu-level-1"><a href="https://www.whitehouse.gov/">White House</a></li>
<li class="leaf menu-links menu-level-1"><a href="https://www.whitehouse.gov/omb/management/egov/">E-gov</a></li>
<li class="leaf menu-links menu-level-1"><a href="https://www.doi.gov/pmb/eeo/no-fear-act">No Fear Act</a></li>
<li class="last leaf menu-links menu-level-1"><a href="https://www.usgs.gov/about/organization/science-support/foia">FOIA</a></li>
</ul>
</div>
<div class="footer-social-links">
<ul class="social">
<li class="follow">Follow</li>
<li class="twitter">
<a href="https://twitter.com/usgs" target="_blank">
<i class="fa fa-twitter-square"><span class="only">Twitter</span></i>
</a>
</li>
<li class="facebook">
<a href="https://facebook.com/usgeologicalsurvey" target="_blank">
<i class="fa fa-facebook-square"><span class="only">Facebook</span></i>
</a>
</li>
<li class="github">
<a href="https://github.com/usgs" target="_blank">
<i class="fa fa-github"><span class="only">GitHub</span></i>
</a>
</li>
<li class="flickr">
<a href="https://flickr.com/usgeologicalsurvey" target="_blank">
<i class="fa fa-flickr"><span class="only">Flickr</span></i>
</a>
</li>
<li class="youtube">
<a href="http://youtube.com/usgs" target="_blank">
<i class="fa fa-youtube-play"><span class="only">YouTube</span></i>
</a>
</li>
<li class="instagram">
<a href="https://instagram.com/usgs" target="_blank">
<i class="fa fa-instagram"><span class="only">Instagram</span></i>
</a>
</li>
</ul>
</div>
</div>
</footer>
\ No newline at end of file
<link href="https://asc-public-docs.s3.us-west-2.amazonaws.com/common/uswds/3.6.0/css/common.css" rel="stylesheet" type="text/css" media="screen" />
<link href="https://asc-public-docs.s3.us-west-2.amazonaws.com/common/uswds/3.6.0/css/custom.css" rel="stylesheet" type="text/css" media="screen" />
<link href="https://asc-public-docs.s3.us-west-2.amazonaws.com/common/uswds/3.6.0/css/uswds.min.css" rel="stylesheet" type="text/css" media="screen" />
<script async type="text/javascript" src="https://dap.digitalgov.gov/Universal-Federated-Analytics-Min.js?agency=DOI" id="_fed_an_ua_tag"></script>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>USGSCSM</title>
</head>
<body>
<script type="text/javascript" src="https://asc-public-docs.s3.us-west-2.amazonaws.com/common/uswds/3.6.0/js/uswds-init.min.js"></script>
<script type="text/javascript" src="https://asc-public-docs.s3.us-west-2.amazonaws.com/common/uswds/3.6.0/js/uswds.min.js"></script>
</body>
</html>
<section class="usa-banner" aria-label="Official government website">
<div class="usa-accordion">
<header class="usa-banner__header">
<div class="usa-banner__inner">
<div class="grid-col-auto">
<img
class="usa-banner__header-flag"
src="https://asc-public-docs.s3.us-west-2.amazonaws.com/common/uswds/3.6.0/img/us_flag_small.png"
alt="U.S. flag"
/>
</div>
<div class="grid-col-fill tablet:grid-col-auto">
<p class="usa-banner__header-text">
An official website of the United States government
</p>
<p class="usa-banner__header-action" aria-hidden="true">
Here’s how you know
</p>
</div>
<button
type="button"
class="usa-accordion__button usa-banner__button"
aria-expanded="false"
aria-controls="gov-banner-default-default"
>
<span class="usa-banner__button-text">Here’s how you know</span>
</button>
</div>
</header>
<div
class="usa-banner__content usa-accordion__content"
id="gov-banner-default-default"
>
<div class="grid-row grid-gap-lg">
<div class="usa-banner__guidance tablet:grid-col-6">
<img
class="usa-banner__icon usa-media-block__img"
src="https://asc-public-docs.s3.us-west-2.amazonaws.com/common/uswds/3.6.0/img/icon-dot-gov.svg"
role="img"
alt=""
aria-hidden="true"
/>
<div class="usa-media-block__body">
<p>
<strong>Official websites use .gov</strong><br />A
<strong>.gov</strong> website belongs to an official government
organization in the United States.
</p>
</div>
</div>
<div class="usa-banner__guidance tablet:grid-col-6">
<img
class="usa-banner__icon usa-media-block__img"
src="https://asc-public-docs.s3.us-west-2.amazonaws.com/common/uswds/3.6.0/img/icon-https.svg"
role="img"
alt=""
aria-hidden="true"
/>
<div class="usa-media-block__body">
<p>
<strong>Secure .gov websites use HTTPS</strong><br />A
<strong>lock</strong> (
<span class="icon-lock"
><svg
xmlns="http://www.w3.org/2000/svg"
width="52"
height="64"
viewBox="0 0 52 64"
class="usa-banner__lock-image"
role="img"
aria-labelledby="banner-lock-title-default banner-lock-description-default"
focusable="false"
>
<title id="banner-lock-title-default">Lock</title>
<desc id="banner-lock-description-default">A locked padlock</desc>
<path
fill="#000000"
fill-rule="evenodd"
d="M26 0c10.493 0 19 8.507 19 19v9h3a4 4 0 0 1 4 4v28a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V32a4 4 0 0 1 4-4h3v-9C7 8.507 15.507 0 26 0zm0 8c-5.979 0-10.843 4.77-10.996 10.712L15 19v9h22v-9c0-6.075-4.925-11-11-11z"
/>
</svg> </span
>) or <strong>https://</strong> means you’ve safely connected to
the .gov website. Share sensitive information only on official,
secure websites.
</p>
</div>
</div>
</div>
</div>
</div>
</section>
<header id="navbar" class="header-nav" role="banner">
<div class="tmp-container">
<div class="header-search">
<a class="logo-header" href="https://www.usgs.gov/" title="Home">
<img class="img" src="https://asc-public-docs.s3.us-west-2.amazonaws.com/common/uswds/3.6.0/img/logo.png" alt="Home" />
</a>
<form action="https://www.usgs.gov/science-explorer-results" method="GET" id="search-box">
<div class="fa-wrapper"><label for="se_search" class="only">Search</label>
<input id="se_search" type="search" name="es" placeholder="Search">
<button class="fa fa-search" type="submit">
<span class="only">Search</span>
</button></div>
</form>
</div>
</div>
</header>
...@@ -793,3 +793,6 @@ div#spc-itemdisp-container h6 { font-size: 100%; } ...@@ -793,3 +793,6 @@ div#spc-itemdisp-container h6 { font-size: 100%; }
/* ---------------------- */ /* ---------------------- */
/* Miscellaneous elements */ /* Miscellaneous elements */
/* ---------------------- */ /* ---------------------- */
.bodywrapper {
min-height: 100vh;
}
...@@ -60,7 +60,7 @@ numpydoc_show_class_members = True ...@@ -60,7 +60,7 @@ numpydoc_show_class_members = True
numpydoc_class_members_toctree = False numpydoc_class_members_toctree = False
# Add any paths that contain templates here, relative to this directory. # Add any paths that contain templates here, relative to this directory.
#templates_path = ['_templates'] templates_path = ['_templates']
# The suffix of source filenames. # The suffix of source filenames.
source_suffix = '.rst' source_suffix = '.rst'
......
...@@ -18,3 +18,4 @@ dependencies: ...@@ -18,3 +18,4 @@ dependencies:
- pytest-cov - pytest-cov
- coveralls - coveralls
- nbsphinx - nbsphinx
- sphinx=6.2.1
name: plio
channels:
- conda-forge
- usgs-astrogeology
dependencies:
- affine
- h5py
- networkx
- nbsphinx
- numpy
- pandas
- protobuf
- pvl
- pyyaml
- sphinx=6.2.1
- sqlalchemy
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment