Skip to content

Refactor

Refactor #211

Workflow file for this run

name: CI/CD
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- main
env:
DATABASE_URL: mongodb://test:password@localhost:27017/?authSource=admin
API_ENV: 🛠
GOOGLE_CLIENT_ID: test
GOOGLE_CLIENT_SECRET: test
MINIO_ACCESS_KEY: test
MINIO_SECRET_KEY: test
jobs:
checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.12
- uses: pre-commit/action@v3.0.0
tests:
runs-on: ubuntu-latest
needs: [checks]
services:
mongodb:
image: mongodb/mongodb-community-server:latest
env:
MONGO_INITDB_ROOT_USERNAME: test
MONGO_INITDB_ROOT_PASSWORD: password
MONGO_INITDB_DATABASE: test
options: >-
--health-cmd mongo
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 27017:27017
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.12
- name: Setup poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: 1.6.1
- name: Install dependencies
run: poetry install
- name: Run tests
run: cd src && poetry run pytest
build_and_publish:
runs-on: ubuntu-latest
needs: [tests]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build and publish app
uses: openzim/docker-publish-action@v10
with:
image-name: collinmutembei/people
on-master: latest
latest-on-tag: true
restrict-to: collinmutembei/people
registries: |
ghcr.io
credentials: |
GHCRIO_USERNAME=${{ github.repository_owner }}
GHCRIO_TOKEN=${{ secrets.CR_PAT }}
build-args: |
PROJECT_VERSION=latest
COMMIT_ID=${{ github.sha }}