Skip to content

Commit

Permalink
Migrate building and deploying the documentation to Github CI. (AMReX…
Browse files Browse the repository at this point in the history
  • Loading branch information
atmyers authored Dec 7, 2020
1 parent 81a56bd commit 0a402ee
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 126 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/dependencies/documentation.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
#
# Copyright 2020 The AMReX Community
#
# License: BSD-3-Clause-LBNL
# Authors: Andrew Myers

set -eu -o pipefail

sudo apt-get update

sudo apt-get install -y --no-install-recommends\
build-essential \
pandoc \
doxygen \
texlive \
texlive-latex-extra \
texlive-lang-cjk \
latexmk

30 changes: 30 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build and Deploy
on: [push, pull_request]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.3.1 # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly.
with:
persist-credentials: false

- name: Dependencies
run: |
.github/workflows/dependencies/documentation.sh
python3 -m pip install sphinx sphinx_rtd_theme breathe
- name: Install and Build
run: |
./build_docs.sh
- name: Deploy
if: github.event_name == 'push' && github.repository == 'AMReX-Codes/amrex' && github.ref == 'refs/heads/development'
uses: JamesIves/github-pages-deploy-action@3.7.1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ACCESS_TOKEN: ${{ secrets.DEPLOY_DOCS }}
REPOSITORY_NAME: AMReX-Codes/AMReX-Codes.github.io
BRANCH: main # The branch the action should deploy to.
FOLDER: build # The folder the action should deploy.
CLEAN: true # Automatically remove deleted files from the deploy branch
35 changes: 0 additions & 35 deletions .travis.yml

This file was deleted.

5 changes: 3 additions & 2 deletions Docs/sphinx_tutorials/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
#

# You can set these variables from the command line.
PYTHON ?= python
SPHINXOPTS =
SPHINXBUILD = python -msphinx
SPHINXBUILD = $(PYTHON) -msphinx
SPHINXPROJ = amrex
SOURCEDIR = source
BUILDDIR = build
Expand All @@ -17,4 +18,4 @@ help:
# 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)
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
89 changes: 0 additions & 89 deletions build_and_deploy.sh

This file was deleted.

39 changes: 39 additions & 0 deletions build_docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash
set -e # Exit with nonzero exit code if anything fails

# Doxygen
echo "Build the Doxygen documentation"
cd Docs/Doxygen
doxygen doxygen.conf &> doxygen.out
cd ../..

# sphinx
cd Docs/sphinx_documentation

echo "Build the Sphinx documentation for Amrex."
make PYTHON="python3" latexpdf
mv build/latex/amrex.pdf source/
make PYTHON="python3" html &> make_source_html.out
#
cd ../sphinx_tutorials
echo "Build the Sphinx documentation for the Amrex tutorials."
make PYTHON="python3" latexpdf &> make_tutorials_latex.out
mv build/latex/amrex.pdf source/
make PYTHON="python3" html &> make_tutorials_html.out
cd ../../

mkdir build
cd build
mkdir amrex
cd amrex
mkdir docs_html tutorials_html docs_xml

# add doxygen
mkdir -p docs_html/doxygen
cp -rp ../../Docs/Doxygen/html/* docs_html/doxygen/
mkdir -p docs_xml/doxygen
cp -rp ../../Docs/Doxygen/xml/* docs_xml/doxygen/

# add sphinx
cp -rp ../../Docs/sphinx_documentation/build/html/* docs_html/
cp -rp ../../Docs/sphinx_tutorials/build/html/* tutorials_html/
Binary file removed deploy_key.enc
Binary file not shown.

0 comments on commit 0a402ee

Please sign in to comment.