Skip to content

Commit

Permalink
CI #955
Browse files Browse the repository at this point in the history
  • Loading branch information
prjemian committed Apr 6, 2024
1 parent 5d51cb0 commit c4b8899
Showing 1 changed file with 56 additions and 53 deletions.
109 changes: 56 additions & 53 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,56 +78,59 @@ jobs:
run: |
TZ=UTC sphinx-build -M html ./docs/source "${TMP_DIR}/build"
- name: Upload Docs ZIP file as artifact
uses: actions/upload-artifact@v4
with:
name: apstools-docs
path: "${TMP_DIR}/build/html"

- name: Re-build the master directory (contains all documentation versions)
run: |
set -vxeuo pipefail
cp .github/index.html "${TMP_DIR}"
cd "${TMP_DIR}"
mv build/html "${VERSION}"
/bin/rm -rf build
ln -s "./${VERSION}" dev
# add previous documentation (built versions)
# update the switcher.json file before a new release
wget https://github.com/BCDA-APS/apstools/archive/refs/heads/gh-pages.zip
unzip -q gh-pages.zip
/bin/rm gh-pages.zip
source "${SRC_DIR}/.github/scripts/define_versions.sh"
for v in ${versions}
do
if [ -d "apstools-gh-pages/${v}" ]
then
echo "directory 'apstools-gh-pages/${v}' exists"
mv "apstools-gh-pages/${v}" ./
latest="${v}"
fi
done
echo "latest=${latest}"
ln -s "./${latest}" ./latest
/bin/rm -rf apstools-gh-pages
- name: Info
run: |
set -vxeuo pipefail
cd "${TMP_DIR}"
echo "pwd=$(pwd)"
ls -laFGh
du -shc *
- name: Publish (push gh-pages branch) only on demand
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.event.inputs.deploy }}
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ${{ env.TMP_DIR }}
force_orphan: true
- name: Build Info
run: ls -lAFghR "${TMP_DIR}/build/html"

# - name: Upload Docs ZIP file as artifact
# uses: actions/upload-artifact@v4
# with:
# name: apstools-docs
# path: "${TMP_DIR}/build/html"

# - name: Re-build the master directory (contains all documentation versions)
# run: |
# set -vxeuo pipefail
# cp .github/index.html "${TMP_DIR}"

# cd "${TMP_DIR}"
# mv build/html "${VERSION}"
# /bin/rm -rf build
# ln -s "./${VERSION}" dev

# # add previous documentation (built versions)
# # update the switcher.json file before a new release
# wget https://github.com/BCDA-APS/apstools/archive/refs/heads/gh-pages.zip
# unzip -q gh-pages.zip
# /bin/rm gh-pages.zip

# source "${SRC_DIR}/.github/scripts/define_versions.sh"
# for v in ${versions}
# do
# if [ -d "apstools-gh-pages/${v}" ]
# then
# echo "directory 'apstools-gh-pages/${v}' exists"
# mv "apstools-gh-pages/${v}" ./
# latest="${v}"
# fi
# done
# echo "latest=${latest}"
# ln -s "./${latest}" ./latest

# /bin/rm -rf apstools-gh-pages

# - name: Info
# run: |
# set -vxeuo pipefail
# cd "${TMP_DIR}"
# echo "pwd=$(pwd)"
# ls -laFGh
# du -shc *

# - name: Publish (push gh-pages branch) only on demand
# uses: peaceiris/actions-gh-pages@v3
# if: ${{ github.event.inputs.deploy }}
# with:
# publish_branch: gh-pages
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: ${{ env.TMP_DIR }}
# force_orphan: true

0 comments on commit c4b8899

Please sign in to comment.