Skip to content

Commit

Permalink
Gh pages fix (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
Risto97 authored Sep 14, 2024
1 parent c89b452 commit 11d80a6
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 24 deletions.
22 changes: 5 additions & 17 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -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 "[email protected]"
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
<img src="docs/static/img/SoCMakeLogo3.png" width="40%"/>
</p>

Check out the [Documentation](https://socmake.docs.cern.ch/)
Check out the [Documentation](https://hep-soc.github.io/SoCMake/)

2 changes: 1 addition & 1 deletion docs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions docs/deps/venv.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: '/',
baseUrl : '/SoCMake/',

// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
Expand Down Expand Up @@ -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',
},
Expand Down

0 comments on commit 11d80a6

Please sign in to comment.