kou commented on code in PR #104:
URL:
https://github.com/apache/arrow-datafusion-python/pull/104#discussion_r1040337838
##########
.github/workflows/docs.yaml:
##########
@@ -0,0 +1,67 @@
+on:
+ push:
+ branches:
+ - master
+ tags:
+ - "!**-rc"
+ paths:
+ - docs/**
+ - .github/workflows/docs.yml
Review Comment:
Do we need this?
I think that this workflow isn't ran when a tagged commit doesn't change
`docs/**`.
##########
.github/workflows/docs.yaml:
##########
@@ -0,0 +1,67 @@
+on:
+ push:
+ branches:
+ - master
+ tags:
+ - "!**-rc"
+ paths:
+ - docs/**
+ - .github/workflows/docs.yml
+
+
+name: Deploy Datafusion Python site
+
+jobs:
+ build-docs:
+ name: Build docs
+ runs-on: ubuntu-latest
+ steps:
+ - name: Set target branch
+ id: target-branch
+ run: |
+ if test '${{ github.ref }}' = 'refs/heads/master'; then
+ echo "value=asf-staging" >> $GITHUB_OUTPUT
+ elif test '${{ github.ref_type }}' = 'tag'; then
+ echo "value=asf-site" >> $GITHUB_OUTPUT
+ fi
Review Comment:
```suggestion
else
echo "Unsupported input: ${{ github.ref }} / ${{ github.ref_type
}}"
exit 1
fi
```
##########
.github/workflows/docs.yaml:
##########
@@ -0,0 +1,67 @@
+on:
+ push:
+ branches:
+ - master
+ tags:
+ - "!**-rc"
+ paths:
+ - docs/**
+ - .github/workflows/docs.yml
+
+
+name: Deploy Datafusion Python site
+
+jobs:
+ build-docs:
+ name: Build docs
+ runs-on: ubuntu-latest
+ steps:
+ - name: Set target branch
+ id: target-branch
+ run: |
+ if test '${{ github.ref }}' = 'refs/heads/master'; then
+ echo "value=asf-staging" >> $GITHUB_OUTPUT
+ elif test '${{ github.ref_type }}' = 'tag'; then
+ echo "value=asf-site" >> $GITHUB_OUTPUT
+ 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:
+ python-version: "3.10"
+
+ - name: Install dependencies
+ run: |
+ python3 -m venv venv
+ source venv/bin/activate
+ pip install -r requirements-310.txt
+ pip install -r docs/requirements.txt
+
+ - name: Build Datafusion
+ run: |
+ source venv/bin/activate
+ maturin develop
+
+ - name: Build docs
+ run: |
+ source venv/bin/activate
+ cd docs
+ make html
+
+ - name: Copy & push the generated HTML
+ run: |
+ cd docs-target
+ find ./ -name "*.html" -type f -print0 | xargs -0 /bin/rm -f
+ cp -r ../docs/build/html/* .
+ git config --global user.name 'GitHub Actions'
+ git config --global user.email '[email protected]'
Review Comment:
```suggestion
git config user.name "github-actions[bot]"
git config user.email
"github-actions[bot]@users.noreply.github.com"
```
We can use https://avatars.githubusercontent.com/in/15368?s=40&v=4 icon with
the email. See also: https://github.com/ruby/csv/commits/gh-pages
##########
.github/workflows/docs.yaml:
##########
@@ -0,0 +1,67 @@
+on:
+ push:
+ branches:
+ - master
+ tags:
+ - "!**-rc"
Review Comment:
Did you try the following tags on your fork?
* `0.8.0-rc1`
* `0.8.0-rc2`
* `0.8.0`
##########
.github/workflows/docs.yaml:
##########
@@ -0,0 +1,67 @@
+on:
+ push:
+ branches:
+ - master
+ tags:
+ - "!**-rc"
+ paths:
+ - docs/**
+ - .github/workflows/docs.yml
+
+
+name: Deploy Datafusion Python site
+
+jobs:
+ build-docs:
+ name: Build docs
+ runs-on: ubuntu-latest
+ steps:
+ - name: Set target branch
+ id: target-branch
+ run: |
+ if test '${{ github.ref }}' = 'refs/heads/master'; then
+ echo "value=asf-staging" >> $GITHUB_OUTPUT
+ elif test '${{ github.ref_type }}' = 'tag'; then
+ echo "value=asf-site" >> $GITHUB_OUTPUT
+ 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:
+ python-version: "3.10"
+
+ - name: Install dependencies
+ run: |
+ python3 -m venv venv
+ source venv/bin/activate
+ pip install -r requirements-310.txt
+ pip install -r docs/requirements.txt
+
+ - name: Build Datafusion
+ run: |
+ source venv/bin/activate
+ maturin develop
+
+ - name: Build docs
+ run: |
+ source venv/bin/activate
+ cd docs
+ make html
+
+ - name: Copy & push the generated HTML
+ run: |
+ cd docs-target
+ find ./ -name "*.html" -type f -print0 | xargs -0 /bin/rm -f
+ cp -r ../docs/build/html/* .
+ git config --global user.name 'GitHub Actions'
+ git config --global user.email '[email protected]'
+ git add --all
+ git commit -m 'Publish built docs triggered by ${{ github.sha }}'
+ git push -f origin ${{ steps.target-branch.outputs.value }}
Review Comment:
Can we omit `origin ${{ steps.target-branch.outputs.value }}` here?
##########
.github/workflows/docs.yaml:
##########
@@ -0,0 +1,67 @@
+on:
+ push:
+ branches:
+ - master
+ tags:
+ - "!**-rc"
+ paths:
+ - docs/**
+ - .github/workflows/docs.yml
+
+
+name: Deploy Datafusion Python site
+
+jobs:
+ build-docs:
+ name: Build docs
+ runs-on: ubuntu-latest
+ steps:
+ - name: Set target branch
+ id: target-branch
+ run: |
+ if test '${{ github.ref }}' = 'refs/heads/master'; then
+ echo "value=asf-staging" >> $GITHUB_OUTPUT
+ elif test '${{ github.ref_type }}' = 'tag'; then
+ echo "value=asf-site" >> $GITHUB_OUTPUT
+ 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:
+ python-version: "3.10"
+
+ - name: Install dependencies
+ run: |
+ python3 -m venv venv
+ source venv/bin/activate
+ pip install -r requirements-310.txt
+ pip install -r docs/requirements.txt
+
+ - name: Build Datafusion
+ run: |
+ source venv/bin/activate
+ maturin develop
+
+ - name: Build docs
+ run: |
+ source venv/bin/activate
+ cd docs
+ make html
+
+ - name: Copy & push the generated HTML
+ run: |
+ cd docs-target
+ find ./ -name "*.html" -type f -print0 | xargs -0 /bin/rm -f
Review Comment:
This may not work for other extensions such as `*.css`. How about using
`rsync`?
```shell
rsync \
-a \
--delete \
--exclude '/.git/' \
../docs/build/html/ \
./
```
##########
.github/workflows/docs.yaml:
##########
@@ -0,0 +1,67 @@
+on:
+ push:
+ branches:
+ - master
+ tags:
+ - "!**-rc"
+ paths:
+ - docs/**
+ - .github/workflows/docs.yml
+
+
+name: Deploy Datafusion Python site
+
+jobs:
+ build-docs:
+ name: Build docs
+ runs-on: ubuntu-latest
+ steps:
+ - name: Set target branch
+ id: target-branch
+ run: |
+ if test '${{ github.ref }}' = 'refs/heads/master'; then
+ echo "value=asf-staging" >> $GITHUB_OUTPUT
+ elif test '${{ github.ref_type }}' = 'tag'; then
+ echo "value=asf-site" >> $GITHUB_OUTPUT
+ 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:
+ python-version: "3.10"
+
+ - name: Install dependencies
+ run: |
+ python3 -m venv venv
+ source venv/bin/activate
+ pip install -r requirements-310.txt
+ pip install -r docs/requirements.txt
+
+ - name: Build Datafusion
+ run: |
+ source venv/bin/activate
+ maturin develop
+
+ - name: Build docs
+ run: |
+ source venv/bin/activate
+ cd docs
+ make html
+
+ - name: Copy & push the generated HTML
+ run: |
+ cd docs-target
+ find ./ -name "*.html" -type f -print0 | xargs -0 /bin/rm -f
+ cp -r ../docs/build/html/* .
+ git config --global user.name 'GitHub Actions'
+ git config --global user.email '[email protected]'
+ git add --all
+ git commit -m 'Publish built docs triggered by ${{ github.sha }}'
+ git push -f origin ${{ steps.target-branch.outputs.value }}
Review Comment:
We may want to add a changed check:
```shell
if [ "$(git status --porcelain)" != "" ]; then
git add ...
git commit ...
git push ...
fi
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]