Skip to content

employee start date and yearly vacation days added to the team member #146

employee start date and yearly vacation days added to the team member

employee start date and yearly vacation days added to the team member #146

name: Backend - Test, Build and Push Docker Image
on:
push:
branches: [ main ]
paths:
- 'backend/**'
jobs:
build_and_push:
runs-on: ubuntu-latest
services:
mongodb:
image: mongo:latest
ports:
- 27017:27017
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- name: Install dependencies
run: |
pip install -U -r backend/requirements.txt
pip install pytest httpx
- name: Run tests with pytest
run: pytest
env:
AUTHENTICATION_SECRET_KEY: b461cb38030c172d3feb5275e3d841087951b8fe88ad9c1697eb5ee41269a135
- name: Extract the short SHA of the commit
shell: bash
run: echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: ./backend
file: ./backend/Dockerfile
push: true
tags: |
ghcr.io/${{ github.repository }}:${{ env.SHORT_SHA }}
ghcr.io/${{ github.repository }}:latest