Add version display to admin header and site footer #30
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: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| paths-ignore: | |
| - '.github/workflows/**' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| test: | |
| runs-on: ubuntu-24.04 | |
| name: Tests with Python | |
| services: | |
| postgres: | |
| image: postgres:15 | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: postgres | |
| ports: ['5432:5432'] | |
| options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 1 | |
| - name: Enable caching | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| python-version: "3.13" | |
| - name: Install dependencies | |
| run: | | |
| uv sync --all-extras --dev --locked --no-editable --no-install-project | |
| - name: Collect Static Assets | |
| env: | |
| DATABASE_URL: 'postgres://postgres:postgres@localhost:${{ job.services.postgres.ports[5432] }}/postgres' | |
| SECRET_KEY: 'for-testing' | |
| run: | | |
| uv run --locked -m manage tailwind --skip-checks download_cli | |
| uv run --locked -m manage tailwind --skip-checks build | |
| uv run --locked -m manage collectstatic --noinput | |
| - name: Test with pytest | |
| env: | |
| DATABASE_URL: 'postgres://postgres:postgres@localhost:${{ job.services.postgres.ports[5432] }}/postgres' | |
| SECRET_KEY: 'for-testing' | |
| run: | | |
| uv run -m pytest | |
| version-bump: | |
| needs: [test] | |
| name: Version Bump | |
| runs-on: ubuntu-24.04 | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 1 | |
| - name: Enable caching | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| python-version: "3.13" | |
| - name: Set up Python | |
| run: uv python install | |
| - name: Configure git to push | |
| run: | | |
| git config --global user.email "actions@users.noreply.github.com" | |
| git config --global user.name "Automated Publisher" | |
| - name: Bump Version | |
| id: vars | |
| run: | | |
| uvx bumpver update | |
| eval $(uvx --quiet bumpver show --environ) | |
| echo "CURRENT_VERSION=$CURRENT_VERSION" >> "$GITHUB_OUTPUT" | |
| uv lock | |
| - name: Commit uv.lock | |
| run: | | |
| # Stage the uv.lock file | |
| git add uv.lock | |
| # Commit only if there are changes | |
| if [ -n "$(git status --porcelain)" ]; then | |
| git commit -m ":arrow_up: Bump uv.lock" | |
| else | |
| echo "No changes to commit." | |
| fi | |
| - name: Push Release Build to GitHub | |
| run: | | |
| git push origin main | |
| git push origin main:production --force |