Skip to content

Merge pull request #127 from Promptly-Technologies-LLC/126-move-templ… #23

Merge pull request #127 from Promptly-Technologies-LLC/126-move-templ…

Merge pull request #127 from Promptly-Technologies-LLC/126-move-templ… #23

Workflow file for this run

name: Publish Documentation
on:
push:
branches: main
jobs:
publish-documentation:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: 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: Configure Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- 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 protected]" >> _environment
- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@v2
- name: Render Documentation
run: |
# Publish Quarto documentation
uv run quarto publish gh-pages --no-prompt --no-browser
# Render README in GitHub Flavored Markdown
uv run quarto render index.qmd --output-dir . --output README.md --to gfm
# Remove index.html if it exists
rm -f index.html
- name: Commit version change
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Update README"
branch: ${{ github.ref_name }}
file_pattern: "README.md"