Copilot commented on code in PR #68:
URL: https://github.com/apache/arrow-erlang/pull/68#discussion_r3490805993


##########
.github/workflows/docs.yml:
##########
@@ -83,8 +70,65 @@ jobs:
       - name: Upload artifact
         uses: actions/upload-pages-artifact@v5
         with:
+          name: docs-${{ github.sha }}
           path: 'doc'
 
-      - name: Deploy to GitHub Pages
-        id: deployment
+  gh_pages:
+    # Only deploy on a push to main
+    if: github.ref_name == 'main' && github.event_name == 'push'
+    name: Deploy to GitHub Pages
+    needs: build
+
+    # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
+    permissions:
+      contents: read
+      pages: write
+      id-token: write
+
+    environment:
+      name: github-pages
+      url: ${{ steps.deployment.outputs.page_url }}
+
+    # Allow only one concurrent deployment
+    concurrency:
+      group: "pages"
+      cancel-in-progress: true
+
+    runs-on: ubuntu-latest
+    steps:
+      - id: deployment
         uses: actions/deploy-pages@v5

Review Comment:
   `actions/upload-pages-artifact` is uploading the Pages artifact with a 
custom name (`docs-${{ github.sha }}`), but `actions/deploy-pages` will look 
for the default `github-pages` artifact unless `artifact_name` is set. This 
will cause the GitHub Pages deployment job to fail to find the artifact.



##########
.github/workflows/docs.yml:
##########
@@ -83,8 +70,65 @@ jobs:
       - name: Upload artifact
         uses: actions/upload-pages-artifact@v5
         with:
+          name: docs-${{ github.sha }}
           path: 'doc'
 
-      - name: Deploy to GitHub Pages
-        id: deployment
+  gh_pages:
+    # Only deploy on a push to main
+    if: github.ref_name == 'main' && github.event_name == 'push'
+    name: Deploy to GitHub Pages
+    needs: build
+
+    # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
+    permissions:
+      contents: read
+      pages: write
+      id-token: write
+
+    environment:
+      name: github-pages
+      url: ${{ steps.deployment.outputs.page_url }}
+
+    # Allow only one concurrent deployment
+    concurrency:
+      group: "pages"
+      cancel-in-progress: true
+
+    runs-on: ubuntu-latest
+    steps:
+      - id: deployment
         uses: actions/deploy-pages@v5
+
+
+  asf_site:
+  # Only deploy on a push to main
+    if: github.ref_name == 'main' && github.event_name == 'push'
+    name: Deploy to arrow.apache.org
+    needs: build
+
+    permissions:
+      contents: write
+
+    # Allow only one concurrent deployment
+    concurrency:
+      group: "asf_site"
+      cancel-in-progress: true
+
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v7
+      - name: Download artifact
+        uses: actions/download-artifact@v8
+        with:
+          name: docs-${{ github.sha }}
+          path: docs
+      - name: Prepare website
+        run: cp .asf.yaml ./docs/.asf.yaml

Review Comment:
   The artifact produced by `actions/upload-pages-artifact` contains 
`artifact.tar` (not an extracted site directory), so publishing `docs/` as-is 
will push a tarball to `asf-site` instead of the rendered docs. Also, 
`actions/download-artifact@v8` does not exist (current major is v5). Download 
with v5 and extract `artifact.tar` before publishing.



##########
.github/workflows/docs.yml:
##########
@@ -83,8 +70,65 @@ jobs:
       - name: Upload artifact
         uses: actions/upload-pages-artifact@v5
         with:
+          name: docs-${{ github.sha }}
           path: 'doc'
 
-      - name: Deploy to GitHub Pages
-        id: deployment
+  gh_pages:
+    # Only deploy on a push to main
+    if: github.ref_name == 'main' && github.event_name == 'push'
+    name: Deploy to GitHub Pages
+    needs: build
+
+    # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
+    permissions:
+      contents: read
+      pages: write
+      id-token: write
+
+    environment:
+      name: github-pages
+      url: ${{ steps.deployment.outputs.page_url }}
+
+    # Allow only one concurrent deployment
+    concurrency:
+      group: "pages"
+      cancel-in-progress: true
+
+    runs-on: ubuntu-latest
+    steps:
+      - id: deployment
         uses: actions/deploy-pages@v5
+
+
+  asf_site:
+  # Only deploy on a push to main
+    if: github.ref_name == 'main' && github.event_name == 'push'

Review Comment:
   The comment above the `asf_site` job is not indented under the job key, 
which makes the YAML harder to read and easy to misinterpret as applying at the 
`jobs:` level. Indent it to align with the rest of the job fields.



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