Benjamin-Philip commented on code in PR #68:
URL: https://github.com/apache/arrow-erlang/pull/68#discussion_r3534187049


##########
.github/workflows/docs.yml:
##########
@@ -85,8 +73,75 @@ jobs:
       - name: Upload artifact
         uses: 
actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
         with:
+          name: docs-${{ github.sha }}
           path: 'doc'
 
-      - name: Deploy to GitHub Pages
-        id: deployment
+  deploy_fork:
+    name: Deploy to GitHub Pages on fork
+    if: >-
+      (github.event_name == 'push' ||
+       github.event_name == 'workflow_dispatch') &&
+       github.repository != 'apache/arrow-erlang'
+    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@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # 
v5.0.0
+        with:
+           artifact_name: docs-${{ github.sha }}
+
+
+  asf_site:
+    # Only deploy on a push to main
+    if: github.ref_name == 'main' && github.event_name == 'push' && 
github.repository == 'apache/arrow-erlang'
+    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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # 
v7.0.0
+        with:
+          persist-credentials: false
+
+      - name: Download artifact
+        uses: 
actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
+        with:
+          name: docs-${{ github.sha }}
+          path: docs
+      - name: Prepare website
+        run: |
+          tar -xf docs/artifact.tar -C asf-site/main
+          cp .asf.yaml asf-site
+          cp .htaccess asf-site

Review Comment:
   I'm copying `.htaccess` here because I don't want to overwrite any 
configuration on HexDocs's side in-case they use Apache.
   
   Since I'm copying `.htaccess` here, I decided I'll copy `.asf.yaml` here as 
well.



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