forked from tinkoff-ai/etna
-
Notifications
You must be signed in to change notification settings - Fork 7
47 lines (45 loc) · 1.56 KB
/
docker-unstable.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
name: Build and push docker image from trunk
on:
push:
branches:
- master
jobs:
docker-build-and-push:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
dockerfile:
- {"name": etna-cpu, "path": docker/etna-cpu/Dockerfile}
- {"name": etna-cuda-11.6.2, "path": docker/etna-cuda-11.6.2/Dockerfile}
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install dependencies
run: |
poetry install -E all -vv
- name: Build image
run: |
cd $( dirname ${{ matrix.dockerfile.path }})
echo "etna[all] @ git+https://github.com/${{ github.repository }}.git@${{ github.sha }}" > requirements.txt
poetry export -E "all jupyter" --without-hashes --format=requirements.txt >> requirements.txt
cat requirements.txt
docker build . --tag image
- name: Log into registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Push image
run: |
IMAGE_ID=ghcr.io/${{ github.repository }}/${{ matrix.dockerfile.name }}
VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag image $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION