Skip to content

Commit

Permalink
Use fixed build dir
Browse files Browse the repository at this point in the history
  • Loading branch information
SilverRainZ committed Jul 23, 2022
1 parent 59fd421 commit f2195c2
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ if [ ! -z "$INPUT_REQUIREMENTS_PATH" ] ; then
echo ::endgroup::
fi

echo ::group:: Creating temp directory
tmp_dir=$(mktemp -d -t pages-XXXXXXXXXX)
echo Temp directory \"$tmp_dir\" is created
echo ::endgroup::
echo ::group:: Creating build directory
build_dir=/tmp/sphinxnotes-pages
mkdir -p $build_dir || true
echo Temp directory \"$build_dir\" is created

echo ::group:: Running Sphinx builder
if ! sphinx-build -b html "$doc_dir" "$tmp_dir"; then
if ! sphinx-build -b html "$doc_dir" "$build_dir"; then
echo ::endgroup::
echo ::group:: Dumping Sphinx error log
for l in $(ls /tmp/sphinx-err*); do
Expand Down Expand Up @@ -82,11 +82,11 @@ echo ::endgroup::
echo ::group:: Committing HTML documentation
cd $repo_dir
echo Deleting all file in repository
rm -vrf *
rm -vrf * # TODO: Keep CNAME
echo Copying HTML documentation to repository
cp -vr $build_dir/. $INPUT_TARGET_PATH
# Remove unused doctree
rm -rf $tmp_dir/.doctrees
cp -vr $tmp_dir/. $INPUT_TARGET_PATH
rm -rf $INPUT_TARGET_PATH/.doctrees
if [ ! -f "$INPUT_TARGET_PATH/.nojekyll" ]; then
# See also sphinxnotes/pages#7
echo Creating .nojekyll file
Expand Down

0 comments on commit f2195c2

Please sign in to comment.