Skip to content

api test added to actions workflow #41

api test added to actions workflow

api test added to actions workflow #41

Workflow file for this run

name: Publish Docker image to DockerHub
on:
push:
branches:
- develop
jobs:
perform_pytest:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Test with pytest
run: |
coverage run -m pytest ./tests/api_test/ -v -s
push_app_to_registry:
name: Push APP Docker image to Docker Hub
needs: perform_pytest
runs-on: ubuntu-latest
steps:
- name: 1 Copy repository
uses: actions/checkout@v2
- name: 2 Docker login
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASSWORD }}
- name: 3 Build APP IMAGE
run: docker build -t app -f ./src/app/backend/dockerfile_api .
- name: 4 Tag
run: |
docker tag app ${{ secrets.DOCKER_USER }}/app:${{ github.sha }}
docker tag app ${{ secrets.DOCKER_USER }}/app:latest
- name: 5 SPush
run: |
docker push ${{ secrets.DOCKER_USER }}/app:${{ github.sha }}
docker push ${{ secrets.DOCKER_USER }}/app:latest
push_web_to_registry:
name: Push WEB Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: 1 Copy repository
uses: actions/checkout@v2
- name: 2 Docker login
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASSWORD }}
- name: 3 Build APP IMAGE
run: docker build -t web -f ./src/app/frontend/dockerfile_web .
- name: 4 Tag
run: |
docker tag web ${{ secrets.DOCKER_USER }}/web:${{ github.sha }}
docker tag web ${{ secrets.DOCKER_USER }}/web:latest
- name: 5 SPush
run: |
docker push ${{ secrets.DOCKER_USER }}/web:${{ github.sha }}
docker push ${{ secrets.DOCKER_USER }}/web:latest