This is an automated email from the ASF dual-hosted git repository.

jamesbognar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/juneau.git


The following commit(s) were added to refs/heads/master by this push:
     new c9b6574c6 Add Docusaurus deployment workflow with staging configuration
c9b6574c6 is described below

commit c9b6574c62faa87a3cae0f98f5271a2398a4be80
Author: James Bognar <[email protected]>
AuthorDate: Tue Sep 23 08:45:08 2025 -0400

    Add Docusaurus deployment workflow with staging configuration
    
    - Add deploy-docs.yml workflow for automated Docusaurus builds
    - Configure .asf.yaml for safe staging deployment (asf-staging)
    - Remove problematic pages.yml workflow
    - Staging site will be available at juneau.staged.apache.org
---
 .asf.yaml                         |   9 +++-
 .github/workflows/deploy-docs.yml |  48 +++++++++++++++++
 .github/workflows/pages.yml       | 109 --------------------------------------
 3 files changed, 55 insertions(+), 111 deletions(-)

diff --git a/.asf.yaml b/.asf.yaml
index d9a6c0590..24ffb360d 100644
--- a/.asf.yaml
+++ b/.asf.yaml
@@ -5,6 +5,11 @@ notifications:
   jira_options: link label worklog
   jobs:         [email protected]
   discussions:  [email protected]
+
+# Configure staging website (safe testing)
+staging:
+  profile: ~
+  whoami: asf-staging
   
 github:
   description: "Apache Juneau"
@@ -15,13 +20,13 @@ github:
     - http
     - rest
     - apache
+    - website
+    - docusaurus
   features:
     wiki: true
     issues: true
     projects: true
     discussions: true
-  ghp_path: "/docs"
-  ghp_branch: "master"
   del_branch_on_merge: true   # Delete head branches after merge
   squash_merge: true          # Allow squash merging
   merge_commit: true          # Allow merge commits
diff --git a/.github/workflows/deploy-docs.yml 
b/.github/workflows/deploy-docs.yml
new file mode 100644
index 000000000..f08b6abe3
--- /dev/null
+++ b/.github/workflows/deploy-docs.yml
@@ -0,0 +1,48 @@
+name: Deploy Documentation
+
+on:
+  push:
+    branches: [main]
+  pull_request:
+    branches: [main]
+
+permissions:
+  contents: write  # Need write access to push to gh-pages
+
+jobs:
+  deploy:
+    runs-on: ubuntu-latest
+    
+    # Only deploy on main branch, not PRs
+    if: github.ref == 'refs/heads/main'
+    
+    steps:
+    - name: Checkout
+      uses: actions/checkout@v4
+      
+    - name: Setup Node.js
+      uses: actions/setup-node@v4
+      with:
+        node-version: '18'
+        cache: 'npm'
+        cache-dependency-path: juneau-docs-poc/package-lock.json
+        
+    - name: Install dependencies
+      run: |
+        cd juneau-docs-poc
+        npm ci
+        
+    - name: Build Docusaurus
+      run: |
+        cd juneau-docs-poc
+        npm run build
+        
+    - name: Deploy to staging branch
+      uses: peaceiris/actions-gh-pages@v3
+      with:
+        github_token: ${{ secrets.GITHUB_TOKEN }}
+        publish_dir: ./juneau-docs-poc/build
+        publish_branch: asf-staging  # Safe staging deployment
+        user_name: 'github-actions[bot]'
+        user_email: 'github-actions[bot]@users.noreply.github.com'
+        commit_message: 'Deploy documentation staging from ${{ github.sha }}'
diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml
deleted file mode 100644
index 33e64b833..000000000
--- a/.github/workflows/pages.yml
+++ /dev/null
@@ -1,109 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-name: Deploy Documentation to GitHub Pages
-
-on:
-  # Runs on pushes targeting the default branch
-  push:
-    branches: [ master, main ]
-    paths:
-      - 'docs/**'
-      - 'juneau-*/**'
-      - 'pom.xml'
-      - '.github/workflows/pages.yml'
-
-  # Allows you to run this workflow manually from the Actions tab
-  workflow_dispatch:
-
-# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
-permissions:
-  contents: read
-  pages: write
-  id-token: write
-
-# Allow only one concurrent deployment, skipping runs queued between the 
in-progress run and latest queued.
-# However, do NOT cancel in-progress runs as we want to allow these production 
deployments to complete.
-concurrency:
-  group: "pages"
-  cancel-in-progress: false
-
-jobs:
-  # Build job
-  build:
-    runs-on: ubuntu-latest
-    steps:
-      - name: Checkout
-        uses: actions/checkout@v5
-
-      - name: Set up JDK 17
-        uses: actions/setup-java@v5
-        with:
-          java-version: '17'
-          distribution: 'temurin'
-
-      - name: Cache Maven dependencies
-        uses: actions/cache@v4
-        with:
-          path: ~/.m2
-          key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
-          restore-keys: ${{ runner.os }}-m2
-
-      - name: Build Documentation Site
-        run: |
-          # Set up environment
-          export JUNEAU_VERSION=$(mvn help:evaluate 
-Dexpression=project.version -q -DforceStdout | grep -v "WARNING")
-          echo "Building site for Juneau version: $JUNEAU_VERSION"
-          
-          # Build and install core modules first (needed for dependencies)
-          mvn clean install -DskipTests
-          
-          # Build juneau-doc module (needed for custom docs)
-          cd juneau-doc
-          mvn install -DskipTests
-          cd ..
-          
-          # Generate complete project site
-          mvn site -DskipTests
-
-      - name: Debug Token Permissions
-        run: |
-          echo "Token permissions check..."
-          curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H 
"Accept: application/vnd.github.v3+json" "https://api.github.com/user"; || echo 
"Token validation failed"
-
-      - name: Setup Pages
-        uses: actions/configure-pages@v4
-        with:
-          # Enable Pages if not already enabled
-          enablement: true
-          token: ${{ secrets.GITHUB_TOKEN }}
-
-      - name: Upload artifact
-        uses: actions/upload-pages-artifact@v3
-        with:
-          # Upload the complete generated site
-          path: './target/site'
-
-  # Deployment job
-  deploy:
-    environment:
-      name: github-pages
-      url: ${{ steps.deployment.outputs.page_url }}
-    runs-on: ubuntu-latest
-    needs: build
-    steps:
-      - name: Deploy to GitHub Pages
-        id: deployment
-        uses: actions/deploy-pages@v4

Reply via email to