-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (50 loc) · 1.38 KB
/
ml.yaml
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
51
52
53
54
55
name: ML CI workflow
on:
push:
paths:
- "services/ml/**"
- ".github/workflows/ml.yaml"
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./services/ml
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install -r requirements.txt
# - name: Run tests
# run: python -m unittest discover tests
build-container:
if: github.ref == 'refs/heads/main'
needs:
- build
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./services/ml
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Login to Yandex Cloud Container Registry
id: login-cr
uses: yc-actions/yc-cr-login@v2
with:
yc-sa-json-credentials: ${{ secrets.YANDEX_SA_KEY }}
- run: |
echo "Packaging docker image ..."
tag="${DOCKER_REGISTRY}/ml:${{ github.sha }}"
docker build -t $tag -t ${DOCKER_REGISTRY}/ml:latest .
docker push ${DOCKER_REGISTRY}/ml --all-tags
env:
DOCKER_REGISTRY: cr.yandex/crpc50gkvq2bp251sfgb