Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
.git
.github
.vscode
.env
.env.*
*.gguf
*.key
*.pem
*.safetensors
llama-cpp-rs
target
*.md
Expand Down
53 changes: 35 additions & 18 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,69 @@
name: Build and push Docker image
name: Build and publish Docker image

on:
push:
branches: [main]
tags: ["v*"]
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read
packages: write

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
id: buildx
uses: docker/setup-buildx-action@v4

- name: Restore BuildKit cache mounts
id: cache-mounts
uses: actions/cache@v5
with:
path: buildkit-cache-mounts
key: buildkit-cache-mounts-${{ runner.os }}-${{ github.sha }}
restore-keys: |
buildkit-cache-mounts-${{ runner.os }}-

- name: Inject BuildKit cache mounts
uses: reproducible-containers/buildkit-cache-dance@v3
with:
builder: ${{ steps.buildx.outputs.name }}
cache-dir: buildkit-cache-mounts
dockerfile: Dockerfile
skip-extraction: ${{ steps.cache-mounts.outputs.cache-hit }}

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata
- name: Generate image metadata
id: meta
uses: docker/metadata-action@v5
uses: docker/metadata-action@v6
with:
images: ghcr.io/${{ github.repository_owner }}/ltengine
images: ghcr.io/${{ github.repository }}
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha,prefix=,suffix=,format=short
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
type=sha,format=long,prefix=

- name: Build and push
uses: docker/build-push-action@v6
uses: docker/build-push-action@v7
with:
context: .
file: Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
cache-from: type=gha,scope=ltengine
cache-to: type=gha,mode=max,scope=ltengine
Loading
Loading