Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Actions] Create new docusaurus version on releases #6

Merged
merged 2 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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