-
Notifications
You must be signed in to change notification settings - Fork 70
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
Add a workflow that builds the docs and deploys them at staged or production #104
Conversation
@andygrove Before merging this PR please create a new branch named |
@kou Please review! |
6056d73
to
a0e9bd6
Compare
…duction Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
a0e9bd6
to
aea783e
Compare
.github/workflows/docs.yaml
Outdated
- name: Copy & push the generated HTML | ||
run: | | ||
cd docs-target | ||
find ./ -name "*.html" -type f -print0 | xargs -0 /bin/rm -f |
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 may not work for other extensions such as *.css
. How about using rsync
?
rsync \
-a \
--delete \
--exclude '/.git/' \
../docs/build/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.
Right! There are .css/.js/images/... !
I have to test your approach!
The important thing is to preserve anything that is not autogenerated, especially .asf.yaml
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.
How about copying .asf.yaml
from master
to asf-site
?
apache/arrow-site uses this approach: apache/arrow-site#116
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 will work for asf-site, but it will break asf-staging, because it uses staging:
instead of publish:
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.
find ./ -not -name ".asf.yaml" | grep -v ".git" | xargs rm -rf
seems to do the trick.
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 will work for asf-site, but it will break asf-staging, because it uses
staging:
instead ofpublish:
Can we write both staging:
and publish:
in master
's .asf.yaml
?
staging:
whoami: asf-staging
subdir: datafusion-python
publish:
whoami: asf-site
subdir: datafusion-python
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 think this should work!
The only way to find out is to try it! :-)
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 think so too. :-)
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.
Co-authored-by: Sutou Kouhei <[email protected]>
52bcc20
to
64dc8d9
Compare
Use special email address for the Git user, so that it has an avatar/icon. Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
64dc8d9
to
e0a6910
Compare
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
d27c482
to
822153e
Compare
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
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.
+1
This almost looks good to me. I think that we can merge this after we confirm that this works with 0.8.0-rc1
and 0.8.0
tags on your fork. (We need to merge this branch to master
on your fork temporary to test these tags.)
.github/workflows/docs.yaml
Outdated
on: | ||
push: | ||
branches: | ||
- docs-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.
We need to change this to master
when we merge this.
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.
Right! I used it to be able to test on my fork!
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.
Done!
- name: Checkout docs target branch | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ steps.target-branch.outputs.value }} | ||
path: docs-target |
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.
It seems that we need to prepare asf-site
and asf-staging
branches for this: https://github.com/martin-g/arrow-datafusion-python/actions/runs/3633415170/jobs/6130403408
How about using git worktree
instead?
diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml
index 806202a..bfafafa 100644
--- a/.github/workflows/docs.yaml
+++ b/.github/workflows/docs.yaml
@@ -26,12 +26,6 @@ jobs:
fi
- name: Checkout docs sources
uses: actions/checkout@v3
- - name: Checkout docs target branch
- uses: actions/checkout@v3
- with:
- fetch-depth: 0
- ref: ${{ steps.target-branch.outputs.value }}
- path: docs-target
- name: Setup Python
uses: actions/setup-python@v4
with:
@@ -61,7 +55,12 @@ jobs:
- name: Copy & push the generated HTML
run: |
set -x
+ git worktree add docs-target
cd docs-target
+ if ! git checkout ${{ steps.target-branch.outputs.value }}; then
+ git checkout --orphan ${{ steps.target-branch.outputs.value }}
+ git rm -rf .
+ fi
# delete anything but: 1) '.'; 2) '..'; 3) .git/
find ./ | grep -vE "^./$|^../$|^./.git" | xargs rm -rf
cp ../.asf.yaml .
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.
IMO this is more complex/confusing than the current solution.
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.
A task before merging this PR is to create asf-staging
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.
Co-authored-by: Sutou Kouhei <[email protected]>
Co-authored-by: Sutou Kouhei <[email protected]>
Actually I already tested tags - see |
Could you retry |
Done! |
Thanks. Committed: martin-g@34ed8b8 I merge this. |
Which issue does this PR close?
Closes #39.
Rationale for this change
Publish the documentation for the Datafusion Python bindings.
When changes are pushed to
master
then it will copy the generated HTMLs toasf-staging
branch and update https://arrow.staged.apache.org/datafusion-python, i.e. the staging site. See Add a workflow that builds the docs and deploys them at staged or production #104 (comment)When changes are pushed to a non-RC tag, e.g.
0.8.0
, then it will copy the generated HTMLs toasf-site
branch and update https://arrow.apache.org/datafusion-python, i.e. the production site. See Issue #39 - Add .asf.yaml for asf-site #105What changes are included in this PR?
A new GitHub Actions workflow is introduced that builds the docs and deploys them at the appropriate site
Are there any user-facing changes?
No API changes!