-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Documentation and Turing Navigation CI improvement (#2484)
* Using Turing actions for docs TuringLang/actions#12 * Update DocsNav.yml Using https://github.com/TuringLang/actions/tree/main/DocsNav reference: TuringLang/actions#12 * Update make.jl No need of deploydocs after using [Turing actions](https://github.com/TuringLang/actions/tree/main/DocsDocumenter) reference: TuringLang/actions#12 * Update Docs.yml * Update .github/workflows/Docs.yml Co-authored-by: Penelope Yong <[email protected]> * Update .github/workflows/DocsNav.yml Co-authored-by: Penelope Yong <[email protected]> --------- Co-authored-by: Penelope Yong <[email protected]>
- Loading branch information
1 parent
eb08db0
commit ddd74b1
Showing
3 changed files
with
25 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,39 @@ | ||
name: Add Navbar | ||
name: Rebuild docs with newest navbar | ||
|
||
on: | ||
page_build: # Triggers the workflow on push events to gh-pages branch | ||
workflow_dispatch: # Allows manual triggering | ||
# 3:25 AM UTC every Sunday -- choose an uncommon time to avoid | ||
# periods of heavy GitHub Actions usage | ||
schedule: | ||
- cron: '0 0 * * 0' # Runs every week on Sunday at midnight (UTC) | ||
- cron: '25 3 * * 0' | ||
# Whenever needed | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
add-navbar: | ||
update-navbar: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
|
||
steps: | ||
- name: Checkout gh-pages | ||
- name: Checkout gh-pages branch | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: gh-pages | ||
fetch-depth: 0 | ||
|
||
- name: Download insert_navbar.sh | ||
run: | | ||
curl -O https://raw.githubusercontent.com/TuringLang/turinglang.github.io/main/assets/scripts/insert_navbar.sh | ||
chmod +x insert_navbar.sh | ||
- name: Insert navbar | ||
uses: TuringLang/actions/DocsNav@main | ||
with: | ||
doc-path: '.' | ||
|
||
- name: Update Navbar | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Commit and push changes | ||
run: | | ||
git config user.name github-actions[bot] | ||
git config user.email github-actions[bot]@users.noreply.github.com | ||
# Define the URL of the navbar to be used | ||
NAVBAR_URL="https://raw.githubusercontent.com/TuringLang/turinglang.github.io/main/assets/scripts/TuringNavbar.html" | ||
# Update all HTML files in the current directory (gh-pages root) | ||
./insert_navbar.sh . $NAVBAR_URL | ||
# Remove the insert_navbar.sh file | ||
rm insert_navbar.sh | ||
# Check if there are any changes | ||
if [[ -n $(git status -s) ]]; then | ||
git add . | ||
git commit -m "Added navbar and removed insert_navbar.sh" | ||
git push "https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" gh-pages | ||
git config user.name github-actions[bot] | ||
git config user.email github-actions[bot]@users.noreply.github.com | ||
git add -A | ||
git commit -m "Update navbar (automated)" | ||
git push | ||
else | ||
echo "No changes to commit" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters