Skip to content

Commit

Permalink
Merge pull request #6 from CristianLara/tutorial-versioning
Browse files Browse the repository at this point in the history
[Actions] Create new docusaurus version on releases
  • Loading branch information
CristianLara authored Dec 3, 2024
2 parents 467af1f + f63a8e9 commit d408683
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/publish_website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,20 @@ jobs:
# name: Run Tutorials
# run: |
# python scripts/run_tutorials.py -w $(pwd)
# - if: ${{ inputs.new_version }}
# name: Create new docusaurus version
# run: |
# git config --global user.name "github-actions[bot]"
# git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
- if: ${{ inputs.new_version }}
name: Create new docusaurus version
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
# python3 scripts/convert_ipynb_to_mdx.py --clean
# cd website
# yarn
# yarn docusaurus docs:version ${{ inputs.new_version }}
python3 scripts/convert_ipynb_to_mdx.py --clean
cd website
yarn
yarn docusaurus docs:version ${{ inputs.new_version }}
# git add --all
# git commit -m "Create version ${{ inputs.new_version }} of site in Docusaurus"
# git push --force origin HEAD:main
git add --all
git commit -m "Create version ${{ inputs.new_version }} of site in Docusaurus"
git push --force origin HEAD:main
- name: Build website
run: |
bash scripts/build_docs.sh -b
Expand Down
5 changes: 3 additions & 2 deletions scripts/convert_ipynb_to_mdx.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,9 @@ def create_buttons(
str: MDX formatted buttons.
"""
version = get_current_git_tag() or "main"
github_url = f"https://github.com/{ORGANIZATION}/{PROJECT}/blob/{version}/tutorials/{nb_metadata['id']}/{nb_metadata['id']}.ipynb"
colab_url = f"https://colab.research.google.com/github/{ORGANIZATION}/{PROJECT}/blob/{version}/tutorials/{nb_metadata['id']}/{nb_metadata['id']}.ipynb"
github_path = f"{ORGANIZATION}/{PROJECT}/blob/{version}/tutorials/{nb_metadata['id']}/{nb_metadata['id']}.ipynb"
github_url = f"https://github.com/{github_path}"
colab_url = f"https://colab.research.google.com/github/{github_path}"
return f'<LinkButtons\n githubUrl="{github_url}"\n colabUrl="{colab_url}"\n/>\n\n'


Expand Down

0 comments on commit d408683

Please sign in to comment.