This repository has been archived by the owner on Mar 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (40 loc) · 1.44 KB
/
ci_cd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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/
pytest route_waypoint_service/tests/
pytest gateway_service/tests/
- name: Build Docker images
run: |
docker build -t ${{ secrets.DOCKER_REPOSITORY }}:user_service ./user_service
docker build -t ${{ secrets.DOCKER_REPOSITORY }}:route_waypoint_service ./route_waypoint_service
docker build -t ${{ secrets.DOCKER_REPOSITORY }}: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 ${{ secrets.DOCKER_REPOSITORY }}:user_service
docker push ${{ secrets.DOCKER_REPOSITORY }}:route_waypoint_service
docker push ${{ secrets.DOCKER_REPOSITORY }}:gateway_service