-
Notifications
You must be signed in to change notification settings - Fork 182
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
feature: trigger doc build on release tag #2301
feature: trigger doc build on release tag #2301
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Flags with carried forward coverage won't be shown. Click here to find out more. |
eaeb693
to
d781667
Compare
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.
LGTM, pending a reply back from @icfaust about #2301 (comment)
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.
overall good, just some nitpicks I noticed.
run: | | ||
# Set git auth for push changes | ||
git config --global user.name "GitHub Actions" | ||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" |
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.
Where does this number come from?
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.
I searched git config and there is a .cache/per-commit/repondmp4e6s/workflows/main.yml so I tried to jsut copy it over, need this config to push the changes
run: | | ||
export LD_LIBRARY_PATH=$(dirname $(dirname $(which python)))/lib:$LD_LIBRARY_PATH | ||
cd doc | ||
./build-doc.sh --gh-pages |
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.
Note: divergence from docs CI by having the --gh-pages flag.
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.
Yes, that's because they do slightly different things. This one with --gh-pages
uses different build options and generates a versioned folder - simply reusing the result from the docs CI and renaming it results in docs that don't render when put under gh-pages.
But that shouldn't be a problem because in the end both of them are using the same software to build the docs, with the same pinned versions from requirements-doc.txt
.
.github/workflows/docs-release.yml
Outdated
if git checkout $DOC_VERSION 2>/dev/null; then | ||
echo "Successfully checked out tag $DOC_VERSION." | ||
else | ||
echo "ERROR: Tag $DOC_VERSION does not exist." |
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.
echo "ERROR: Tag $DOC_VERSION does not exist." | |
echo "::error:: Tag $DOC_VERSION does not exist." |
Maybe this for something more informative to the user of github actions
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.
Fixed thx!
.github/workflows/docs-release.yml
Outdated
export DOC_VERSION="${GITHUB_REF#refs/tags/}" | ||
# Error out if cannot find version | ||
if [ -z "$DOC_VERSION" ]; then | ||
echo "ERROR: Failed to determine documentation version." |
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.
echo "ERROR: Failed to determine documentation version." | |
echo "::error:: Failed to determine documentation version." |
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.
Fixed thx!
.github/workflows/docs-release.yml
Outdated
|
||
jobs: | ||
build-docs: | ||
runs-on: ubuntu-latest |
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.
runs-on: ubuntu-latest | |
runs-on: ubuntu-24.04 |
@Alexsandruss will know better, but we like to have fixed versions for the runners.
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.
Fixed thx!
.github/workflows/docs-release.yml
Outdated
|
||
# Checkout gh-pages branch | ||
if ! git checkout gh-pages; then | ||
echo "ERROR: Could not checkout gh-pages branch!" |
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.
echo "ERROR: Could not checkout gh-pages branch!" | |
echo "::error:: Could not checkout gh-pages branch!" |
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.
Fixed thx!
.github/workflows/docs-release.yml
Outdated
cp -R "$DEPLOY_DIR/$SHORT_DOC_VERSION" latest | ||
cp "$DEPLOY_DIR/index.html" . | ||
if ! diff -r "$SHORT_DOC_VERSION" latest > /dev/null; then | ||
echo "ERROR: Content mismatch between $SHORT_DOC_VERSION and latest directories" |
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.
echo "ERROR: Content mismatch between $SHORT_DOC_VERSION and latest directories" | |
echo "::error:: Content mismatch between $SHORT_DOC_VERSION and latest directories" |
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.
Fixed thx!
- name: Deploy Documentation to gh-pages | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | |
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 run call is 57 lines long, ideally it should be a separate shell script located in .github/scripts/
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.
Moved now I have a doc_release.sh in scripts
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.
I had the impression that the scripts were meant to be executable both locally and on GH.
This script would mostly be about git commands which are specific to this particular workflow and not reusable elsewhere. I think it makes sense to keep it here.
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.
@Alexsandruss @homksei please weigh in on this, as we are both inferring about the rules of the codebase when it comes to this topic.
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.
@david-cortes-intel As far as I see, the script is a general deployment script which the only git commands which are specific to github is the setting the username and email, which could be maintained in the workflow.
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.
Yes, that sounds like a reasonable split.
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.
Thx for the suggestions! Moved git config back to yml
doc/sources/_templates/layout.html
Outdated
{% endblock %} | ||
{% include "versions.html" %} | ||
{{ super() }} | ||
{% endblock %} |
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.
Endline here needs to be added (unless it breaks the html).
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.
Fixed thx!
doc/versions.json
Outdated
} | ||
] | ||
] |
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.
another newline here.
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.
Fixed thx!
.github/scripts/doc_release.sh
Outdated
git add doc/versions.json | ||
git add index.html | ||
git commit . -m "Automatic doc update for version $DOC_VERSION" | ||
git push origin gh-pages |
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.
newline here
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.
Fixed thx!
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.
Just add the endline to the one file and can merge.
Description
Hi all,
This PR intends to automate the process to release sklearnex doc. Main changes are in a new file called doc-release.yml. Automation will be triggered if a valid tag is pushed.
Best
PR completeness and readability
Testing