From 81f5383e9882e129a9bbe76d9db0d77ab13d9403 Mon Sep 17 00:00:00 2001 From: "Matias N. Goldberg" Date: Fri, 10 Nov 2023 20:04:45 -0300 Subject: [PATCH] Improve Doxygen CI --- .github/workflows/main.yml | 15 +++++++---- ...i_doxygen_step0.sh => build_ci_doxygen.sh} | 13 +++++++--- .../BuildScripts/build_ci_doxygen_step1.sh | 26 ------------------- 3 files changed, 19 insertions(+), 35 deletions(-) rename Scripts/BuildScripts/{build_ci_doxygen_step0.sh => build_ci_doxygen.sh} (78%) delete mode 100755 Scripts/BuildScripts/build_ci_doxygen_step1.sh diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index af8fc6f89f6..ec02171f924 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,13 +17,18 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Build Doxygen - working-directory: ./ - run: ./Scripts/BuildScripts/build_ci_doxygen_step0.sh - uses: actions/checkout@v4 with: ref: gh-pages path: gh-pages - - name: Publish Doxygen + + - name: Build Doxygen working-directory: ./ - run: ./Scripts/BuildScripts/build_ci_doxygen_step1.sh + run: ./Scripts/BuildScripts/build_ci_doxygen.sh + + - name: Publish # Only on master branch + if: github.ref == 'refs/heads/master' + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./gh-pages diff --git a/Scripts/BuildScripts/build_ci_doxygen_step0.sh b/Scripts/BuildScripts/build_ci_doxygen.sh similarity index 78% rename from Scripts/BuildScripts/build_ci_doxygen_step0.sh rename to Scripts/BuildScripts/build_ci_doxygen.sh index e5992bad88f..39a7b5bb220 100755 --- a/Scripts/BuildScripts/build_ci_doxygen_step0.sh +++ b/Scripts/BuildScripts/build_ci_doxygen.sh @@ -29,8 +29,13 @@ cmake \ -DCMAKE_CXX_STANDARD=11 \ -G Ninja ../.. || exit $? ninja OgreDoc || exit $? -cd ../.. || exit $? -# echo "--- Checking out gh-pages branch ---" -# git checkout gh-pages || exit $? -echo "Done Step 0!" +echo "--- Going to gh-pages repo ---" +cd ../../gh-pages || exit $? +cd api || exit $? +echo "--- Removing old ${OGRE_VERSION} ---" +rm -rf ${OGRE_VERSION} || exit $? +echo "--- Copying new ${OGRE_VERSION} ---" +mv ../../build/Doxygen/api/html ${OGRE_VERSION} || exit $? + +echo "Done!" diff --git a/Scripts/BuildScripts/build_ci_doxygen_step1.sh b/Scripts/BuildScripts/build_ci_doxygen_step1.sh deleted file mode 100755 index ae0b590d352..00000000000 --- a/Scripts/BuildScripts/build_ci_doxygen_step1.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -if [ -z "$OGRE_VERSION" ]; then - echo "OGRE_VERSION is not set. Aborting!" - exit 1; -fi - -# echo "--- Checking out gh-pages branch ---" -# git checkout gh-pages || exit $? -cd gh-pages || exit $? -cd api || exit $? -echo "--- Removing old ${OGRE_VERSION} ---" -git rm -rf ${OGRE_VERSION} || exit $? -rm -rf ${OGRE_VERSION} || exit $? -echo "--- Copying new ${OGRE_VERSION} ---" -mv ../../build/Doxygen/api/html ${OGRE_VERSION} || exit $? -git config user.email "github-actions" -git config user.name "github-actions@github.com" -echo "--- Adding to ${OGRE_VERSION} to git ---" -git add ${OGRE_VERSION} || exit $? -echo "--- Committing ---" -git commit -m "Deploy GH" || exit $? -echo "--- Pushing repo... ---" -git push || exit $? - -echo "Done Step 1!"