Skip to content

Commit

Permalink
Merge pull request #182 from cticenhour/site-action-updates
Browse files Browse the repository at this point in the history
Website generation action updates
  • Loading branch information
csdechant authored Mar 3, 2023
2 parents 07f8fa5 + d61ba51 commit fc5c983
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 38 deletions.
51 changes: 16 additions & 35 deletions .github/workflows/generate_website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ on:
jobs:
build-website:
runs-on: ubuntu-latest
# https://github.com/marketplace/actions/setup-miniconda#use-a-default-shell
# Set up a default shell for all steps
# See: https://github.com/marketplace/actions/setup-miniconda#use-a-default-shell
defaults:
run:
shell: bash -el {0}
Expand All @@ -24,46 +25,26 @@ jobs:
use-mamba: true
activate-environment: zapdos
environment-file: scripts/conda_environment.yml
# Note for build step: GitHub-hosted runners are currently limited to 2 cores
# GitHub-hosted runners are currently limited to 2 cores
# See: https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
- name: Build Zapdos
run: |
conda activate zapdos
make -j2
- name: Build Zapdos Doxygen
- name: Build Doxygen
uses: mattnotmitt/[email protected]
with:
doxyfile-path: 'doc/doxygen/Doxyfile'
# Generated Doxygen files are owned by the root user (the GitHub default user for docker-based actions).
# However, we need it to be owned by the runner user. GitHub allows passwordless sudo, so let's do a sudo chown.
# See: https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#user
# See: https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#administrative-privileges
- name: Set Doxygen files ownership
run: sudo chown -R $(id --user):$(id --group) doc/doxygen/doxygen
# GITHUB_WORKSPACE contains the location of the repository when using the checkout action
# See: https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables
- name: Build Zapdos documentation
doxyfile-path: 'doc/Doxyfile'
- name: Build MooseDocs
run: |
cd doc
./moosedocs.py build --destination=$GITHUB_WORKSPACE/../zapdos-site
- name: Clean-up Zapdos
run: |
git submodule deinit -f moose crane squirrel
git clean -xfd
git reset --hard HEAD
# GITHUB_SHA contains the commit SHA that triggered the workflow (the head commit of the master branch)
- name: Checkout gh-pages and push new website
run: |
git fetch origin gh-pages
git checkout gh-pages
rm -rf *
cd $GITHUB_WORKSPACE/../zapdos-site
rm test.html
mv * $GITHUB_WORKSPACE
cd $GITHUB_WORKSPACE
git status
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "Update zapdos website based on $GITHUB_SHA"
git push origin gh-pages
./moosedocs.py build --destination site
- name: Update gh-pages branch
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./doc/site
user_name: github-actions
user_email: [email protected]
commit_message: "Update zapdos website based on"
# The commit SHA that triggered the action is added to the end of the above message.
4 changes: 2 additions & 2 deletions doc/doxygen/Doxyfile → doc/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ PROJECT_LOGO =
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.

OUTPUT_DIRECTORY = doc/doxygen
OUTPUT_DIRECTORY = doc/content

# If the CREATE_SUBDIRS tag is set to YES then doxygen will create up to 4096
# sub-directories (in 2 levels) under the output directory of each output format
Expand Down Expand Up @@ -1236,7 +1236,7 @@ HTML_FILE_EXTENSION = .html
# of the possible markers and block names see the documentation.
# This tag requires that the tag GENERATE_HTML is set to YES.

HTML_HEADER =
HTML_HEADER = doc/content/doxygen/zapdos_header.html

# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
# generated HTML page. If the tag is left blank doxygen will generate a standard
Expand Down
1 change: 0 additions & 1 deletion doc/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ Content:
- ${MOOSE_DIR}/framework/doc/content
- ${ROOT_DIR}/crane/doc/content
- ${ROOT_DIR}/squirrel/doc/content
- ${ROOT_DIR}/doc/doxygen/
- python_files:
root_dir: ${MOOSE_DIR}/python/doc/content
content:
Expand Down
File renamed without changes.
75 changes: 75 additions & 0 deletions doc/content/doxygen/zapdos_header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<!-- HTML header for doxygen 1.9.5-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="$langISO">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen $doxygenversion"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
<link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/>
<!--BEGIN DISABLE_INDEX-->
<!--BEGIN FULL_SIDEBAR-->
<script type="text/javascript">var page_layout=1;</script>
<!--END FULL_SIDEBAR-->
<!--END DISABLE_INDEX-->
<script type="text/javascript" src="$relpath^jquery.js"></script>
<script type="text/javascript" src="$relpath^dynsections.js"></script>
$treeview
$search
$mathjax
$darkmode
<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
$extrastylesheet
</head>
<body>
<!--BEGIN DISABLE_INDEX-->
<!--BEGIN FULL_SIDEBAR-->
<div id="side-nav" class="ui-resizable side-nav-resizable"><!-- do not remove this div, it is closed by doxygen! -->
<!--END FULL_SIDEBAR-->
<!--END DISABLE_INDEX-->

<div id="top"><!-- do not remove this div, it is closed by doxygen! -->

<!--BEGIN TITLEAREA-->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<!--BEGIN PROJECT_LOGO-->
<td id="projectlogo"><img alt="Logo" src="$relpath^$projectlogo"/></td>
<!--END PROJECT_LOGO-->
<!--BEGIN PROJECT_NAME-->
<td id="projectalign">
<a href="https://shannon-lab.github.io/zapdos" style="text-decoration:none"><div id="projectname">$projectname</div></a><div id="projectname">
<!--BEGIN PROJECT_NUMBER--><span id="projectnumber">&#160;$projectnumber</span><!--END PROJECT_NUMBER-->
</div>
<!--BEGIN PROJECT_BRIEF--><div id="projectbrief">$projectbrief</div><!--END PROJECT_BRIEF-->
</td>
<!--END PROJECT_NAME-->
<!--BEGIN !PROJECT_NAME-->
<!--BEGIN PROJECT_BRIEF-->
<td>
<div id="projectbrief">$projectbrief</div>
</td>
<!--END PROJECT_BRIEF-->
<!--END !PROJECT_NAME-->
<!--BEGIN DISABLE_INDEX-->
<!--BEGIN SEARCHENGINE-->
<!--BEGIN !FULL_SIDEBAR-->
<td>$searchbox</td>
<!--END !FULL_SIDEBAR-->
<!--END SEARCHENGINE-->
<!--END DISABLE_INDEX-->
</tr>
<!--BEGIN SEARCHENGINE-->
<!--BEGIN FULL_SIDEBAR-->
<tr><td colspan="2">$searchbox</td></tr>
<!--END FULL_SIDEBAR-->
<!--END SEARCHENGINE-->
</tbody>
</table>
</div>
<!--END TITLEAREA-->
<!-- end header part -->

0 comments on commit fc5c983

Please sign in to comment.