Skip to content

Fix pgbouncer image tag (1.22.1 -> 1.22.1-p0) #87

Fix pgbouncer image tag (1.22.1 -> 1.22.1-p0)

Fix pgbouncer image tag (1.22.1 -> 1.22.1-p0) #87

Workflow file for this run

name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
backend:
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
cache-dependency-path: backend/requirements.txt
- name: Install deps
run: |
pip install --upgrade pip
pip install -r requirements.txt
pip install ruff mypy pytest pytest-cov
- name: Lint (ruff)
run: ruff check . --output-format=github
- name: Tests
env:
JWT_SECRET_KEY: ci-test-secret-key-at-least-32-characters-long-xxxx
APP_ENV: test
DATABASE_URL: sqlite:///./test.db
ENABLE_DEV_PAYMENT: "1"
SCHEDULER_ENABLED: "0"
run: pytest -v --cov=. --cov-report=xml --cov-report=term
- name: Upload coverage
if: success()
uses: actions/upload-artifact@v4
with:
name: backend-coverage
path: backend/coverage.xml
frontend:
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: Install
run: npm ci
- name: TypeScript
run: npx tsc --noEmit
- name: ESLint
run: npm run lint --if-present
- name: Build
env:
NEXT_PUBLIC_API_URL: http://localhost:8000
NEXT_PUBLIC_SITE_URL: http://localhost:3000
run: npm run build
docker:
runs-on: ubuntu-latest
needs: [backend, frontend]
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build & push backend
uses: docker/build-push-action@v5
with:
context: ./backend
push: true
tags: |
ghcr.io/${{ github.repository }}/backend:latest
ghcr.io/${{ github.repository }}/backend:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build & push frontend
uses: docker/build-push-action@v5
with:
context: ./frontend
push: true
tags: |
ghcr.io/${{ github.repository }}/frontend:latest
ghcr.io/${{ github.repository }}/frontend:${{ github.sha }}
build-args: |
NEXT_PUBLIC_API_URL=${{ secrets.NEXT_PUBLIC_API_URL }}
NEXT_PUBLIC_SITE_URL=${{ secrets.NEXT_PUBLIC_SITE_URL }}
NEXT_PUBLIC_TURNSTILE_SITE_KEY=${{ secrets.NEXT_PUBLIC_TURNSTILE_SITE_KEY }}
cache-from: type=gha
cache-to: type=gha,mode=max
permissions:
contents: read
packages: write