Skip to content

start reading segment #30

start reading segment

start reading segment #30

Workflow file for this run

name: Check and Build
on:
- push
- pull_request
jobs:
test_and_lint:
runs-on: ubuntu-latest
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_SERVER: localhost:5432
POSTGRES_DB: test
defaults:
run:
working-directory: .
services:
db:
image: postgres:15.1-alpine
ports:
- '5432:5432'
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
strategy:
matrix:
python-version: [3.11]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Setup Poetry
run: pip install poetry
- name: Install dependencies
run: make install
- name: Apply migrations
run: make migrate
- name: Run check
run: make check
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
fail_ci_if_error: true
build:
needs: test_and_lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push backend
uses: docker/build-push-action@v4
with:
context: .
file: ./docker/backend/Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/bibliograph-back:latest
- name: Build and push frontend
uses: docker/build-push-action@v4
with:
context: .
file: ./docker/frontend/Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/bibliograph-front:latest