Skip to content

Commit

Permalink
MAINT: Update GH actions
Browse files Browse the repository at this point in the history
Sync with changes in other repos
  • Loading branch information
bashtage committed Mar 19, 2021
1 parent 9b87123 commit 6e2e75d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/generate-documentation.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Generate Documentation

on:
release:
types: [published]
push:
branches:
- main
Expand Down Expand Up @@ -42,4 +44,6 @@ jobs:
make html
popd
- name: Deploy documentation
env:
GIT_TAG: ${{ github.event.release.tag_name }}
run: source ci/github-actions/push-docs-gh-pages.sh
19 changes: 11 additions & 8 deletions ci/github-actions/push-docs-gh-pages.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash

export GIT_REPO_DIR=${PWD}
echo "Set git email and name"
git config user.email "[email protected]"
git config user.name "Kevin Sheppard"
Expand All @@ -11,22 +12,24 @@ rm -rf devel
echo "Make a new devel"
mkdir devel
echo "Checking for tag"
GIT_TAG=$(git name-rev --name-only --tags HEAD)
if [[ ${GIT_TAG} == "undefined" ]]; then
echo "Tag is ${GIT_TAG}. Not updating main documents"
else
if [[ -n "${GIT_TAG}" ]]; then
echo "Tag ${GIT_TAG} is defined"
echo "Copy docs to root"
echo cp -r ${PWD}/doc/build/html/* ${PWD}/
cp -r ${PWD}/doc/build/html/* ${PWD}
git add Documentation/\*.html
git add Documentation/\*.css
git add Documentation/\*.js
else
echo "Tag is ${GIT_TAG}. Not updating main documents"
fi
echo "Copy docs to devel"
echo cp -r ${PWD}/doc/build/html/* ${PWD}/devel/
cp -r ${PWD}/doc/build/html/* ${PWD}/devel/
echo "Add devel"
echo "Clean up docs"
cd ${GIT_REPO_DIR}/doc
make clean && git clean -xfd
echo "Add files"
cd ${GIT_REPO_DIR}
git add .
# Ensure key files are added
git add devel/**/* || true
git add **/*.html || true
git add **/*.ipynb || true
Expand Down

0 comments on commit 6e2e75d

Please sign in to comment.