-
Notifications
You must be signed in to change notification settings - Fork 0
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
Replacing bash script with Julia script for inserting navbar #11
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great - very lightweight code and well structured!
I have a few comments just to polish the edges really.
@penelopeysm Thanks, I have updated the script with your suggested changes, let me know if we should add anything else! One more thing, can we just schedule only DocsNav part of DocsDocumenter workflow on weekly basis so if our navbar script or navbar itself changes then we won't have to manually trigger workflows in all repos + we should also add worklow dispatch event in all repos so we can also trigger it manually if required...! Most of our repos still use |
Hmmm, that's an interesting one. I do see the utility there. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super happy with everything else :)
I don't think we can schedule composite actions, let's just add a schedule in all workflow to run docs: schedule:
- cron: '0 0 * * 0' # Runs every week on Sunday at midnight (UTC) |
Let's merge this first so we can fix all broken docs! |
I'm thinking about how Documenter.jl attempts to be very smart about what docs it deploys. This isn't to do with our workflows, it's baked into Documenter.jl itself. For example https://turinglang.org/DynamicPPL.jl/stable/ - this subdir is only updated when Documenter is run on a new tag https://turinglang.org/DynamicPPL.jl/dev/ - this subdir is updated when Documenter is run on the main branch https://turinglang.org/DynamicPPL.jl/v0.34/ - this subdir is updated when Documenter is run on 0.34 But if we update the navbar, we presumably want to edit all the subdirs at once. I think the only way to do that is something like this name: Update navbar
on:
schedule:
- cron: '0 0 * * 0'
workflow_dispatch:
jobs:
update-navbar:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: gh-pages
[... install julia...]
- name: Replace navbar
uses: TuringLang/actions/DocsNav@v(whatever)
with:
doc-path: '.' What do you think? (Also, yes, it's definitely time to update all the workflows in the organisation repos. That'll be great fun 😅 ) |
Should I tag it with v3? As it's a major change, Bash to Julia! |
I think we can be liberal with version numbers so yes :) |
How about something like this: name: "Documentation"
on:
push:
branches:
- main
tags: '*'
pull_request:
branches:
- main
schedule:
- cron: '0 0 * * 0'
workflow_dispatch:
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
jobs:
docs:
runs-on: ubuntu-latest
if: github.event_name != 'schedule'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build and deploy Documenter.jl docs
uses: TuringLang/actions/DocsDocumenter@(whatever)
update-navbar:
runs-on: ubuntu-latest
if: github.event_name == 'schedule'
steps:
- name: Checkout gh-pages branch
uses: actions/checkout@v4
with:
ref: gh-pages
- name: Insert navbar
uses: TuringLang/actions/DocsNav@(whatever)
with:
julia: true (conditional installation😅)
doc-path: '.'
navbar-url: ${{ github.action_path }}/DocsNav/scripts/TuringNavbar.html
- name: Commit and push changes
run: |
if [[ -n $(git status -s) ]]; then
git add .
git commit -m "Update navbar (automated)"
git push "https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" gh-pages
else
echo "No changes to commit"
fi |
I think I have a slight preference for having two separate workflows, but yeah, that general structure should work! |
Where would you like to go from here? Should we maybe update the workflows on DynamicPPL to start? Then once we're happy with it + confident that it works we can copy paste to the other repos? |
I am fine with both approaches, but having only one workflow will require less future efforts in case of any change.
DynamicPPLs docs are broken so let's start with it, I guess you have owner access for DynamicPPL so can you test it out there, then I will start opening PRs for all other repos! |
Closes #9 #10