-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (84 loc) · 2.52 KB
/
main.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# Train model, build containerized model, and deploy model
name: CI/CD
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
# Run workflow manually from the Actions tab
workflow_dispatch:
jobs:
# train:
# runs-on: ubuntu-latest
# steps:
# # Checks-out repository under $GITHUB_WORKSPACE, so the job can access it
# - uses: actions/checkout@v3
# - name: Set up Python 3.10.*
# uses: actions/setup-python@v1
# with:
# python-version: 3.10.*
# - name: Install dependencies
# run: |
# make install
# - name: Add project path to sys.path
# run: |
# echo "PYTHONPATH=${{github.workspace}}" >> $GITHUB_ENV
# - name: Sort imports with isort
# run: |
# make isort
# - name: Format with black
# run: |
# make format
# - name: Test with pytest
# run: |
# make test
# - name: Lint with pylint
# run: |
# make lint
# - name: Prepare data
# run: |
# make prep_data
# - name: Setup Feast
# run: |
# make setup_feast
# - name: Split data
# run: |
# make split_data
# - name: Train
# env:
# COMET_API_KEY: ${{secrets.COMET_API_KEY}}
# run: |
# make train
# - name: Evaluate models
# env:
# COMET_API_KEY: ${{secrets.COMET_API_KEY}}
# run: |
# make evaluate
# - name: Test champion model
# env:
# COMET_API_KEY: ${{secrets.COMET_API_KEY}}
# run: |
# make test_model
build:
runs-on: ubuntu-latest
# needs: train
steps:
- uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
# Login using same GitHub Actions credentials
- name: Log in to GitHub container registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
# Ensures that repo name is lowercase, which is a requirement for publishing to ghcr.io
- name: Lowercase the repo name and username
run: echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV}
- name: Build and push container image to registry
uses: docker/build-push-action@v2
with:
push: true
tags: ghcr.io/${{ env.REPO }}:${{ github.sha }}
file: ./src/inference/Dockerfile