Update docs/overview/concepts/farmer_registry_concepts.md #450
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and deploy OpenSPP documentation | |
| on: | |
| push: | |
| branches-ignore: | |
| - cf-pages | |
| jobs: | |
| build_deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| submodules: true | |
| - name: Setup Graphviz | |
| uses: ts-graphviz/setup-graphviz@v1 | |
| - name: Set up Python 3.10 | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| cache: 'pip' | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get install libsasl2-dev libldap2-dev libssl-dev && | |
| pip install -q -r requirements_frozen.txt | |
| # - name: Run Vale | |
| # run: make vale | |
| # - name: Run linkcheck | |
| # run: make linkcheck | |
| # Set safe branch name for preview deployments | |
| - name: Set safe branch name | |
| if: github.ref != 'refs/heads/stable' | |
| id: branch | |
| run: | | |
| # Sanitize branch name: only allow alphanumeric, dots, underscores, hyphens | |
| # Replace all other characters with hyphens and limit to 50 characters | |
| SAFE_NAME=$(echo ${GITHUB_REF_NAME} | sed 's/[^a-zA-Z0-9._-]/-/g' | cut -c1-50) | |
| echo "safe=${SAFE_NAME}" >> $GITHUB_OUTPUT | |
| # Build documentation with appropriate environment variables | |
| - name: Prepare deploy (stable) | |
| if: github.ref == 'refs/heads/stable' | |
| run: | | |
| set -e # Exit on error | |
| export DOCS_VERSION=stable | |
| export DOCS_BASEURL=https://docs.openspp.org/ | |
| export IS_PREVIEW=0 | |
| export DOCS_GITHUB_VERSION=stable | |
| make deploy || { echo "Build failed"; exit 1; } | |
| - name: Prepare deploy (preview) | |
| if: github.ref != 'refs/heads/stable' | |
| run: | | |
| set -e # Exit on error | |
| export DOCS_VERSION=${{ steps.branch.outputs.safe }} | |
| export DOCS_BASEURL=https://docs.openspp.org/previews/${{ steps.branch.outputs.safe }}/ | |
| export IS_PREVIEW=1 | |
| export DOCS_GITHUB_VERSION=${GITHUB_REF_NAME} | |
| make deploy || { echo "Build failed"; exit 1; } | |
| # Deploy stable documentation (main branch) | |
| - name: Deploy stable documentation (to cf-pages branch) | |
| if: github.ref == 'refs/heads/stable' | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: _build/html | |
| publish_branch: cf-pages | |
| keep_files: true # Don't delete preview versions | |
| # Deploy preview documentation (non-main branches) | |
| - name: Deploy preview documentation (to cf-pages branch) | |
| if: github.ref != 'refs/heads/stable' | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: _build/html | |
| publish_branch: cf-pages | |
| destination_dir: previews/${{ steps.branch.outputs.safe }} | |
| keep_files: true # Don't delete other versions | |
| - name: Display deployment status | |
| run: | | |
| if [ "${{ github.ref }}" == "refs/heads/stable" ]; then | |
| echo "✅ Deployed stable documentation to https://docs.openspp.org/" | |
| else | |
| BRANCH_SAFE=$(echo ${GITHUB_REF_NAME} | sed 's/\//-/g') | |
| echo "✅ Deployed preview documentation to https://docs.openspp.org/previews/${BRANCH_SAFE}/" | |
| fi |