Skip to content

Sfix: specify in README MODELS_CACHE_DIR for docker #5

Sfix: specify in README MODELS_CACHE_DIR for docker

Sfix: specify in README MODELS_CACHE_DIR for docker #5

name: Build and deploy when pushing on staging or main
on:
push:
branches:
- main
jobs:
build-and-push:
name: Build and push to ${{ github.ref_name }}/${{ github.sha }}
runs-on: ubuntu-latest
env:
IMAGE_NAME: ghcr.io/${{ github.repository }}/app
IMAGE_TAG: ${{ github.sha }}
steps:
# Cuda image is large, so we need to free up some space before building
- name: Free Disk Space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push app
uses: docker/build-push-action@v6
with:
context: .
file: ./app/Dockerfile
push: true
tags: ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }},${{ env.IMAGE_NAME }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max