kou commented on code in PR #104:
URL: 
https://github.com/apache/arrow-datafusion-python/pull/104#discussion_r1042642456


##########
.github/workflows/docs.yaml:
##########
@@ -0,0 +1,76 @@
+on:
+  push:
+    branches:
+      - docs-workflow
+    tags-ignore:
+      - "**-rc**"
+
+name: Deploy Datafusion Python site

Review Comment:
   ```suggestion
   name: Deploy DataFusion Python site
   ```



##########
.github/workflows/docs.yaml:
##########
@@ -0,0 +1,76 @@
+on:
+  push:
+    branches:
+      - docs-workflow
+    tags-ignore:
+      - "**-rc**"
+
+name: Deploy Datafusion Python site
+
+jobs:
+  build-docs:
+    name: Build docs
+    runs-on: ubuntu-latest
+    steps:
+      - name: Set target branch
+        id: target-branch
+        run: |
+          set -x
+          if test '${{ github.ref }}' = 'refs/heads/docs-workflow'; then
+            echo "value=asf-staging" >> $GITHUB_OUTPUT
+          elif test '${{ github.ref_type }}' = 'tag'; then
+            echo "value=asf-site" >> $GITHUB_OUTPUT
+          else
+            echo "Unsupported input: ${{ github.ref }} / ${{ github.ref_type 
}}"
+            exit 1
+          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

Review Comment:
   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
   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 .
   ```



##########
.github/workflows/docs.yaml:
##########
@@ -0,0 +1,76 @@
+on:
+  push:
+    branches:
+      - docs-workflow

Review Comment:
   We need to change this to `master` when we merge this.



##########
.github/workflows/docs.yaml:
##########
@@ -0,0 +1,76 @@
+on:
+  push:
+    branches:
+      - docs-workflow
+    tags-ignore:
+      - "**-rc**"
+
+name: Deploy Datafusion Python site
+
+jobs:
+  build-docs:
+    name: Build docs
+    runs-on: ubuntu-latest
+    steps:
+      - name: Set target branch
+        id: target-branch
+        run: |
+          set -x
+          if test '${{ github.ref }}' = 'refs/heads/docs-workflow'; then
+            echo "value=asf-staging" >> $GITHUB_OUTPUT
+          elif test '${{ github.ref_type }}' = 'tag'; then
+            echo "value=asf-site" >> $GITHUB_OUTPUT
+          else
+            echo "Unsupported input: ${{ github.ref }} / ${{ github.ref_type 
}}"
+            exit 1
+          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: |
+          set -x
+          python3 -m venv venv
+          source venv/bin/activate
+          pip install -r requirements-310.txt
+          pip install -r docs/requirements.txt
+      

Review Comment:
   ```suggestion
   
   ```



-- 
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]

Reply via email to