This repository has been archived by the owner on Mar 9, 2024. It is now read-only.
Update and rename python-package.yml to ci_cd.yml #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI and CD | |
on: | |
push: | |
branches: [ "master" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.12"] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.12' | |
- name: Install dependencies | |
run: | | |
pip install -r user_service/requirements.txt | |
pip install -r route_waypoint_service/requirements.txt | |
pip install -r gateway_service/requirements.txt | |
- name: Run tests | |
run: | | |
pytest user_service/tests/ | |
- name: Build Docker images | |
run: | | |
docker build -t bogdanpolygalov/hse-sa-microservice:user_service ./user_service | |
docker build -t bogdanpolygalov/hse-sa-microservice:route_waypoint_service ./route_waypoint_service | |
docker build -t bogdanpolygalov/hse-sa-microservice:gateway_service ./gateway_service | |
- name: Log in to Docker Hub | |
run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} | |
- name: Push Docker images | |
run: | | |
docker push bogdanpolygalov/hse-sa-microservice:user_service | |
docker push bogdanpolygalov/hse-sa-microservice:route_waypoint_service | |
docker push bogdanpolygalov/hse-sa-microservice:gateway_service |