From 11d80a6d3be746501ef80696214a551a2b434e65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Risto=20Peja=C5=A1inovi=C4=87?= Date: Sat, 14 Sep 2024 09:08:21 +0200 Subject: [PATCH] Gh pages fix (#52) --- .github/workflows/pages.yml | 22 +++++----------------- README.md | 2 +- docs/CMakeLists.txt | 2 +- docs/deps/venv.cmake | 5 +++-- docs/docusaurus.config.js | 6 +++--- 5 files changed, 13 insertions(+), 24 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index d844e77..4cafb91 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -3,7 +3,7 @@ name: docs_pages_workflow # execute this workflow automatically when a we push to master on: push: - branches: [ master ] + branches: [ develop ] jobs: @@ -34,22 +34,10 @@ jobs: mkdir -p docs/build cd docs/build cmake ../ - make api_doc + make docusaurus_doc - - name: Init new repo in dist folder and commit generated files - run: | - cd html/ - git init - touch .nojekyll - git add -A - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git commit -m 'deploy' - - - name: Force push to destination branch - uses: ad-m/github-push-action@master + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} - branch: gh-pages - force: true - directory: ./docs/_build/html + publish_dir: ./docs/build/docusaurus diff --git a/README.md b/README.md index 584b7ec..93121c0 100644 --- a/README.md +++ b/README.md @@ -2,5 +2,5 @@

-Check out the [Documentation](https://socmake.docs.cern.ch/) +Check out the [Documentation](https://hep-soc.github.io/SoCMake/) diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt index e1d6010..a685ad8 100644 --- a/docs/CMakeLists.txt +++ b/docs/CMakeLists.txt @@ -19,7 +19,7 @@ set(DOC_OUTPUT_DIR "${PROJECT_BINARY_DIR}/api_source") set(HTML_SPHINX_OUTPUT_DIR "${PROJECT_BINARY_DIR}/api_html") # Cminx is used to convert SoCMake function comments into rST format later transformed to a # static html documentation using sphinx -set(VENV_CMD ${Python3_VIRTUAL_ENV}/bin/cminx -o ${DOC_OUTPUT_DIR} -r ${DOC_INPUT_DIR}) +set(VENV_CMD $ENV{VIRTUAL_ENV}/bin/cminx -o ${DOC_OUTPUT_DIR} -r ${DOC_INPUT_DIR}) # This command trigger the rST to html conversion and copy into the docusaurus static folder for # integration with the latter set(DOC_API_MAKE_CMD make -C ${PROJECT_BINARY_DIR}/api_source/ html) diff --git a/docs/deps/venv.cmake b/docs/deps/venv.cmake index b15bbf6..1486375 100644 --- a/docs/deps/venv.cmake +++ b/docs/deps/venv.cmake @@ -3,8 +3,9 @@ if(DEPS_USE_VENV) # Create the python virtual environment if not already done if(NOT DEFINED ENV{VIRTUAL_ENV}) # Set an environment variable as activating a virtual env would do - set(ENV{VIRTUAL_ENV} "${PYTHON_VENV_BASE_DIR}/.venv") + set(ENV{VIRTUAL_ENV} "${CMAKE_CURRENT_LIST_DIR}/_deps/.venv") endif() + message("VIRTUAL_ENV: $ENV{VIRTUAL_ENV}") # The previous coommand tricks find_package() to look for a python interpreter under the # VIRUTAL_ENV path. Note that if the venv is deleted, the Python3_EXECUTABLE is still cached so it # generates an error (in this case delete the CMakeCache.txt) @@ -13,7 +14,7 @@ if(DEPS_USE_VENV) string(FIND "${Python3_EXECUTABLE}" $ENV{VIRTUAL_ENV}/bin/python IN_VENV) if(NOT IN_VENV EQUAL 0) # If no venv exist, create one - execute_process (COMMAND "${Python3_EXECUTABLE}" -m venv "${PYTHON_VENV_BASE_DIR}/.venv") + execute_process (COMMAND "${Python3_EXECUTABLE}" -m venv $ENV{VIRTUAL_ENV}) # The virtual environment is used before any other standard paths to look-up for the interpreter set(Python3_FIND_VIRTUALENV FIRST) # Remove the python executable to search for the venv one diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index 6708161..1466510 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -13,10 +13,10 @@ const config = { favicon: 'img/SoCMakeLogo3.svg', // Set the production url of your site here - url: 'https://socmake-docs.cern.ch', + url: 'https://hep-soc.github.io', // Set the // pathname under which your site is served // For GitHub pages deployment, it is often '//' - baseUrl: '/', + baseUrl : '/SoCMake/', // GitHub pages deployment config. // If you aren't using GitHub pages, you don't need these. @@ -72,7 +72,7 @@ const config = { label: 'Documentation', }, { - href: 'https://gitlab.cern.ch/socmake/SoCMake', + href: 'https://hep-soc.github.io/SoCMake/', label: 'GitLab', position: 'right', },