Try to install pscopg2 prereqs in sphinx gh action part 8 #192
This file contains 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: Sphinx build | |
on: | |
push: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build HTML | |
uses: ammaraskar/sphinx-action@master | |
with: | |
pre-build-command: | | |
# Install necessary dependencies | |
apt-get update -y && \ | |
apt-get install -y gcc python3-dev libpq-dev postgresql-client && \ | |
# Ensure pg_config is available and add it to PATH if needed | |
if ! command -v pg_config &> /dev/null; then | |
PG_CONFIG_PATH=$(find /usr/lib/postgresql -type f -name pg_config | head -n 1) | |
if [ -n "$PG_CONFIG_PATH" ]; then | |
export PATH=$(dirname "$PG_CONFIG_PATH"):$PATH | |
else | |
echo "pg_config not found, exiting..." >&2 | |
exit 1 | |
fi | |
fi | |
# Validate pg_config installation | |
pg_config --version | |
env: | |
SETUPTOOLS_SCM_PRETEND_VERSION: 1 | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: html-docs | |
path: docs/_build/html/ | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
if: github.ref == 'refs/heads/main' | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: docs/_build/html |