Skip to content

add README.md

add README.md #13

name: Build and push Docker image
on:
schedule:
- cron: "0 10 * * *"
push:
branches:
- "main"
tags:
- "v*.*.*"
pull_request:
branches:
- "main"
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Clean unused files
run: |
sudo rm -rf /usr/local/lib/android || true # will release about 10 GB
sudo rm -rf /usr/share/dotnet || true # will release about 20GB
sudo rm -rf /opt/ghc || true
sudo rm -rf /usr/local/.ghcup || true
- name: Checkout repository
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- name: Install dependencies
run: |
pip install -e .
pip install "torch>=2.2.2" "numpy>=1.24.4,<2.0.0" "pytest"
- name: Run tests
run: pytest .
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/servicenow/fast-llm
tags: |
type=schedule
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
type=raw,value=latest,enabled={{github.ref == 'refs/heads/main'}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=ghcr.io/servicenow/fast-llm:cache
cache-to: type=registry,ref=ghcr.io/servicenow/fast-llm:cache,mode=max