fix: add Postgres-backed rate limiter for multi-worker deployments (#… #84
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: Publish Documentation | |
| on: | |
| push: | |
| branches: main | |
| jobs: | |
| publish-documentation: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: write | |
| pages: write | |
| services: | |
| postgres: | |
| image: postgres:latest | |
| env: | |
| POSTGRES_DB: test_db | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - name: Generate token for version incrementer app | |
| id: create_token | |
| uses: tibdex/github-app-token@v2 | |
| with: | |
| app_id: ${{ secrets.APP_ID }} | |
| private_key: ${{ secrets.PRIVATE_KEY }} | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ github.sha }} | |
| token: ${{ steps.create_token.outputs.token }} | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: "Set up Python" | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version-file: "pyproject.toml" | |
| - name: Install dependencies | |
| run: uv sync | |
| - name: Set up Quarto | |
| uses: quarto-dev/quarto-actions/setup@v2 | |
| - name: Set required env variables | |
| run: | | |
| echo "DB_USER=postgres" > _environment | |
| echo "DB_PASSWORD=postgres" >> _environment | |
| echo "DB_HOST=127.0.0.1" >> _environment | |
| echo "DB_PORT=5432" >> _environment | |
| echo "DB_NAME=test_db" >> _environment | |
| echo "SECRET_KEY=$(openssl rand -base64 32)" >> _environment | |
| echo "BASE_URL=http://localhost:8000" >> _environment | |
| echo "RESEND_API_KEY=resend_api_key" >> _environment | |
| echo "EMAIL_FROM=noreply@promptlytechnologies.com" >> _environment | |
| - name: Setup Graphviz | |
| uses: ts-graphviz/setup-graphviz@v2 | |
| - name: Build Documentation | |
| run: | | |
| set -a | |
| source _environment | |
| set +a | |
| PYTHONPATH=. uv run great-docs build | |
| - name: Deploy Documentation | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ steps.create_token.outputs.token }} | |
| publish_dir: ./great-docs/_site | |
| publish_branch: gh-pages | |
| force_orphan: false |