44 push :
55 branches :
66 - " **"
7+ branches-ignore :
8+ - cf-pages
79
810jobs :
911 build_deploy :
3234
3335 # Set safe branch name for preview deployments
3436 - name : Set safe branch name
35- if : github.ref != 'refs/heads/main '
37+ if : github.ref != 'refs/heads/stable '
3638 id : branch
3739 run : |
3840 # Sanitize branch name: only allow alphanumeric, dots, underscores, hyphens
@@ -41,48 +43,52 @@ jobs:
4143 echo "safe=${SAFE_NAME}" >> $GITHUB_OUTPUT
4244
4345 # Build documentation with appropriate environment variables
44- - name : Prepare deploy (main/ stable)
45- if : github.ref == 'refs/heads/main '
46+ - name : Prepare deploy (stable)
47+ if : github.ref == 'refs/heads/stable '
4648 run : |
4749 set -e # Exit on error
4850 export DOCS_VERSION=stable
4951 export DOCS_BASEURL=https://docs.openspp.org/
5052 export IS_PREVIEW=0
53+ export DOCS_GITHUB_VERSION=stable
5154 make deploy || { echo "Build failed"; exit 1; }
5255
5356 - name : Prepare deploy (preview)
54- if : github.ref != 'refs/heads/main '
57+ if : github.ref != 'refs/heads/stable '
5558 run : |
5659 set -e # Exit on error
5760 export DOCS_VERSION=${{ steps.branch.outputs.safe }}
5861 export DOCS_BASEURL=https://docs.openspp.org/previews/${{ steps.branch.outputs.safe }}/
5962 export IS_PREVIEW=1
63+ export DOCS_GITHUB_VERSION=${GITHUB_REF_NAME}
6064 make deploy || { echo "Build failed"; exit 1; }
6165
6266 # Deploy stable documentation (main branch)
63- - name : Deploy stable documentation
64- if : github.ref == 'refs/heads/main '
67+ - name : Deploy stable documentation (to cf-pages branch)
68+ if : github.ref == 'refs/heads/stable '
6569 uses : peaceiris/actions-gh-pages@v3
6670 with :
6771 github_token : ${{ secrets.GITHUB_TOKEN }}
6872 publish_dir : _build/html
73+ publish_branch : cf-pages
6974 keep_files : true # Don't delete preview versions
7075
7176 # Deploy preview documentation (non-main branches)
72- - name : Deploy preview documentation
73- if : github.ref != 'refs/heads/main '
77+ - name : Deploy preview documentation (to cf-pages branch)
78+ if : github.ref != 'refs/heads/stable '
7479 uses : peaceiris/actions-gh-pages@v3
7580 with :
7681 github_token : ${{ secrets.GITHUB_TOKEN }}
7782 publish_dir : _build/html
83+ publish_branch : cf-pages
7884 destination_dir : previews/${{ steps.branch.outputs.safe }}
7985 keep_files : true # Don't delete other versions
8086
8187 - name : Display deployment status
8288 run : |
83- if [ "${{ github.ref }}" == "refs/heads/main " ]; then
89+ if [ "${{ github.ref }}" == "refs/heads/stable " ]; then
8490 echo "✅ Deployed stable documentation to https://docs.openspp.org/"
8591 else
8692 BRANCH_SAFE=$(echo ${GITHUB_REF_NAME} | sed 's/\//-/g')
8793 echo "✅ Deployed preview documentation to https://docs.openspp.org/previews/${BRANCH_SAFE}/"
88- fi
94+ fi
0 commit comments