Skip to content

Commit

Permalink
CI: Apply code review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
jngrad committed May 3, 2021
1 parent 5bad4b1 commit f0211a6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 9 additions & 6 deletions .github/actions/deploy_docs/action.yml
Expand Up @@ -8,26 +8,29 @@ runs:
cd "${HOME}"
git clone --quiet git@github.com:espressomd/espressomd.github.io.git
cd espressomd.github.io
LAST_COMMIT=$(git log -1 --pretty=format:"%s" remotes/origin/main -- doc dox tutorials)
# check if already up-to-date (i.e. the commit SHA of the
# generated docs is identical to the current commit SHA)
LAST_COMMIT=$(git log -1 --pretty=format:"%s" remotes/origin/main)
NEXT_COMMIT="Documentation for ${GITHUB_SHA}"
if [ "${NEXT_COMMIT}" = "${LAST_COMMIT}" ]; then
echo "Documentation already up-to-date.";
exit 0;
fi
# download artifacts
curl https://gitlab.icp.uni-stuttgart.de/espressomd/espresso/-/jobs/artifacts/python/download?job=run_tutorials -L -o tutorials.zip
curl https://gitlab.icp.uni-stuttgart.de/espressomd/espresso/-/jobs/artifacts/python/download?job=run_doxygen -L -o doxygen.zip
curl https://gitlab.icp.uni-stuttgart.de/espressomd/espresso/-/jobs/artifacts/python/download?job=check_sphinx -L -o sphinx.zip
curl https://gitlab.icp.uni-stuttgart.de/espressomd/espresso/-/jobs/artifacts/python/download?job=run_tutorials --fail -L -o tutorials.zip
curl https://gitlab.icp.uni-stuttgart.de/espressomd/espresso/-/jobs/artifacts/python/download?job=run_doxygen --fail -L -o doxygen.zip
curl https://gitlab.icp.uni-stuttgart.de/espressomd/espresso/-/jobs/artifacts/python/download?job=check_sphinx --fail -L -o sphinx.zip
if grep -F '<!DOCTYPE html>' *.zip; then
echo "The artifacts could not be downloaded.";
exit 1;
fi
unzip -q '*.zip'
# create a fresh main branch
# create a fresh main branch containing the docs of old releases
git config --global user.email "noreply@icp.uni-stuttgart.de"
git config --global user.name "espresso-ci"
git checkout -b new_main remotes/origin/releases
# generate the landing page
# generate the landing page by merging the branch containing the
# HTML theme and Markdown files, then convert them to HTML files
git merge --quiet --commit --no-edit --allow-unrelated-histories remotes/origin/landing_page
make tutorials.md
for filename in *.md; do
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/deploy.yml
@@ -1,8 +1,6 @@
name: deploy

on:
push:
pull_request:
schedule:
- cron: '0 7 * * *'

Expand Down

0 comments on commit f0211a6

Please sign in to comment.