Skip to content

Github workflow for nightly builds #307

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/nightly-image-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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 }} .
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I'd prefer to use podman here instead of docker, but I won't block the PR on it.

- 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 }}