forked from project-codeflare/codeflare-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (47 loc) · 1.77 KB
/
nightly-image-build.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
name: Nightly Image Build
on:
workflow_dispatch:
push:
branches:
- main
env:
PYTHON_VERSION: 3.8
POETRY_VERSION: 1.5.1
QUAY_ORGANIZATION: 'project-codeflare'
SDK_FILE: 'codeflare_sdk-0.0.0.dev0.tar.gz'
IMAGE_TAG: 'dev'
jobs:
nightly-build:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ env.POETRY_VERSION }}
- name: Run poetry install
run: poetry install --with docs
- name: Run poetry build
run: poetry build
- name: Copy SDK package
run: cp dist/${SDK_FILE} custom-nb-image
- name: Modify Dockerfile to use locally built SDK
run: |
sed -i "s/ARG SDK_VERSION=.*/COPY ${{ env.SDK_FILE }} ./" custom-nb-image/Dockerfile
sed -i "s/codeflare-sdk==.*/${{ env.SDK_FILE }}\\\\/" custom-nb-image/Dockerfile
- name: Image Build
working-directory: custom-nb-image
run: docker build -t quay.io/${{ env.QUAY_ORGANIZATION }}/notebook:${{ env.IMAGE_TAG }} .
- name: Login to Quay.io
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAY_ID }}
password: ${{ secrets.QUAY_TOKEN }}
- name: Image Push
run: docker push quay.io/${{ env.QUAY_ORGANIZATION }}/notebook:${{ env.IMAGE_TAG }}