Skip to content

Commit 6e2e75d

Browse files
committed
MAINT: Update GH actions
Sync with changes in other repos
1 parent 9b87123 commit 6e2e75d

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

.github/workflows/generate-documentation.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Generate Documentation
22

33
on:
4+
release:
5+
types: [published]
46
push:
57
branches:
68
- main
@@ -42,4 +44,6 @@ jobs:
4244
make html
4345
popd
4446
- name: Deploy documentation
47+
env:
48+
GIT_TAG: ${{ github.event.release.tag_name }}
4549
run: source ci/github-actions/push-docs-gh-pages.sh

ci/github-actions/push-docs-gh-pages.sh

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env bash
22

3+
export GIT_REPO_DIR=${PWD}
34
echo "Set git email and name"
45
git config user.email "[email protected]"
56
git config user.name "Kevin Sheppard"
@@ -11,22 +12,24 @@ rm -rf devel
1112
echo "Make a new devel"
1213
mkdir devel
1314
echo "Checking for tag"
14-
GIT_TAG=$(git name-rev --name-only --tags HEAD)
15-
if [[ ${GIT_TAG} == "undefined" ]]; then
16-
echo "Tag is ${GIT_TAG}. Not updating main documents"
17-
else
15+
if [[ -n "${GIT_TAG}" ]]; then
1816
echo "Tag ${GIT_TAG} is defined"
1917
echo "Copy docs to root"
2018
echo cp -r ${PWD}/doc/build/html/* ${PWD}/
2119
cp -r ${PWD}/doc/build/html/* ${PWD}
22-
git add Documentation/\*.html
23-
git add Documentation/\*.css
24-
git add Documentation/\*.js
20+
else
21+
echo "Tag is ${GIT_TAG}. Not updating main documents"
2522
fi
2623
echo "Copy docs to devel"
2724
echo cp -r ${PWD}/doc/build/html/* ${PWD}/devel/
2825
cp -r ${PWD}/doc/build/html/* ${PWD}/devel/
29-
echo "Add devel"
26+
echo "Clean up docs"
27+
cd ${GIT_REPO_DIR}/doc
28+
make clean && git clean -xfd
29+
echo "Add files"
30+
cd ${GIT_REPO_DIR}
31+
git add .
32+
# Ensure key files are added
3033
git add devel/**/* || true
3134
git add **/*.html || true
3235
git add **/*.ipynb || true

0 commit comments

Comments
 (0)