Skip to content
name: docker-nightly-build
on:
schedule:
# Set the time to be 20 mins after the pypi nightly build
- cron: '55 10 * * *' # 10:55am UTC, 2:55am PST, 5:55am EST
workflow_dispatch:
push:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set up Python 3.10
uses: actions/setup-python@v4
- name: Find the release version
run: |
PACKAGE_NAME="skypilot-nightly"
# Fetch package info from PyPI
PACKAGE_INFO=$(curl -s https://pypi.org/pypi/$PACKAGE_NAME/json)
# Parse JSON and get the latest version
LATEST_VERSION=$(echo $PACKAGE_INFO | jq -r '.info.version')
- name: Setup Dockerfile
run: |
touch Dockerfile
cat <<EOF > Dockerfile
FROM continuumio/miniconda3:4.11.0
# Install dependencies
RUN conda install -c conda-forge google-cloud-sdk && \
apt update -y && \
apt install rsync vim -y && \
rm -rf /var/lib/apt/lists/*
RUN pip install "skypilot-nightly[aws,gcp,azure,kubernetes]==$LATEST_VERSION" --no-cache-dir
EOF
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
with:
context: .
push: true
tags: "$DOCKER_USERNAME/skypilot-nightly:latest,$DOCKER_USERNAME/skypilot-nightly:$LATEST_VERSION"
cache-from: type=gha
cache-to: type=gha,mode=max