Skip to content

fix: reset conf.py before switching to v2 branch #510

fix: reset conf.py before switching to v2 branch

fix: reset conf.py before switching to v2 branch #510

Workflow file for this run

name: Build and deploy OpenSPP documentation (previews only)
# NOTE: stable branch is now handled by build_deploy_multiversion.yml
# This workflow only handles preview deployments for other branches
on:
push:
branches-ignore:
- cf-pages
- stable # stable is handled by multiversion workflow
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
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 preview documentation
- name: Prepare deploy (preview)
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 preview documentation
- name: Deploy preview documentation (to cf-pages branch)
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: |
BRANCH_SAFE=$(echo ${GITHUB_REF_NAME} | sed 's/\//-/g')
echo "✅ Deployed preview documentation to https://docs.openspp.org/previews/${BRANCH_SAFE}/"