Added Docker image support with CD pipeline for PyPI and container registry publishing.
CI / Formatting (push) Successful in 6s
CI / Linting (push) Successful in 4s
CI / Tests (Python 3.12) (push) Successful in 19s
CI / Tests (Python 3.13) (push) Successful in 20s
CI / Tests (Python 3.14) (push) Successful in 17s
CI / Type Checking (push) Successful in 8s
CI / Spelling (push) Successful in 5s
CD / Publish Package (push) Successful in 23s
CD / Publish Image (push) Successful in 55s
CI / Formatting (push) Successful in 6s
CI / Linting (push) Successful in 4s
CI / Tests (Python 3.12) (push) Successful in 19s
CI / Tests (Python 3.13) (push) Successful in 20s
CI / Tests (Python 3.14) (push) Successful in 17s
CI / Type Checking (push) Successful in 8s
CI / Spelling (push) Successful in 5s
CD / Publish Package (push) Successful in 23s
CD / Publish Image (push) Successful in 55s
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
# CI / repo metadata
|
||||
.gitea/
|
||||
.gitmodules
|
||||
docs/
|
||||
|
||||
# Development / IDE
|
||||
.venv/
|
||||
venv/
|
||||
.idea/
|
||||
.vscode/
|
||||
*.swp
|
||||
*.swo
|
||||
|
||||
# Runtime data (bind-mounted, not baked in)
|
||||
data/
|
||||
logs/
|
||||
modules/
|
||||
config.yaml
|
||||
|
||||
# Build artifacts
|
||||
dist/
|
||||
build/
|
||||
*.egg-info/
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
|
||||
# Tests and quality tooling
|
||||
tests/
|
||||
.coverage
|
||||
.pytest_cache/
|
||||
|
||||
# AI assistant files
|
||||
CLAUDE.md
|
||||
AGENTS.md
|
||||
|
||||
# Docker build files
|
||||
Dockerfile
|
||||
.dockerignore
|
||||
@@ -0,0 +1,63 @@
|
||||
name: CD
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: ["v*"]
|
||||
|
||||
jobs:
|
||||
publish-package:
|
||||
name: Publish Package
|
||||
runs-on: logaldeveloper-archlinux
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Cache uv packages
|
||||
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
|
||||
with:
|
||||
path: ~/.cache/uv
|
||||
key: uv-${{ hashFiles('uv.lock') }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: uv sync
|
||||
|
||||
- name: Build package
|
||||
run: uv build
|
||||
|
||||
- name: Publish package
|
||||
run: uv publish
|
||||
env:
|
||||
UV_PUBLISH_TOKEN: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
|
||||
publish-image:
|
||||
name: Publish Image
|
||||
runs-on: logaldeveloper-archlinux
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
|
||||
with:
|
||||
driver-opts: network=host
|
||||
|
||||
- name: Log in to Gitea Container Registry
|
||||
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
|
||||
with:
|
||||
registry: git.logal.dev
|
||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
|
||||
- name: Build and push image
|
||||
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2
|
||||
with:
|
||||
context: .
|
||||
network: host
|
||||
push: true
|
||||
tags: |
|
||||
git.logal.dev/logaldeveloper/owlbot:${{ gitea.ref_name }}
|
||||
git.logal.dev/logaldeveloper/owlbot:latest
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
FROM git.logal.dev/logaldeveloper/ci-base:latest AS build
|
||||
|
||||
ENV UV_LINK_MODE=copy \
|
||||
UV_PYTHON_DOWNLOADS=never \
|
||||
UV_PROJECT_ENVIRONMENT=/app/.venv
|
||||
|
||||
WORKDIR /app
|
||||
COPY pyproject.toml uv.lock ./
|
||||
RUN uv sync --no-dev --frozen --no-install-project
|
||||
COPY . .
|
||||
RUN uv sync --no-dev --frozen --no-editable
|
||||
|
||||
FROM archlinux:base
|
||||
|
||||
LABEL org.opencontainers.image.title="Owlbot" \
|
||||
org.opencontainers.image.description="A modular, event-driven chat bot for Owncast" \
|
||||
org.opencontainers.image.url="https://git.logal.dev/LogalDeveloper/Owlbot" \
|
||||
org.opencontainers.image.source="https://git.logal.dev/LogalDeveloper/Owlbot" \
|
||||
org.opencontainers.image.documentation="https://git.logal.dev/LogalDeveloper/Owlbot/wiki" \
|
||||
org.opencontainers.image.vendor="Logan Fick" \
|
||||
org.opencontainers.image.authors="Logan Fick" \
|
||||
org.opencontainers.image.licenses="Apache-2.0" \
|
||||
org.opencontainers.image.base.name="archlinux:base"
|
||||
|
||||
RUN echo 'Server = https://mirrors.logal.dev/archlinux/$repo/os/$arch' > /etc/pacman.d/mirrorlist \
|
||||
&& pacman -Syu --noconfirm ffmpeg python \
|
||||
&& yes | pacman -Scc
|
||||
RUN useradd --uid 1000 --user-group --create-home owlbot
|
||||
|
||||
WORKDIR /app
|
||||
COPY --from=build --chown=owlbot:owlbot /app/.venv /app/.venv
|
||||
RUN mkdir -p data modules \
|
||||
&& chown owlbot:owlbot /app /app/data /app/modules
|
||||
|
||||
ENV PATH="/app/.venv/bin:$PATH"
|
||||
USER owlbot
|
||||
|
||||
VOLUME ["/app/data", "/app/modules"]
|
||||
EXPOSE 8081
|
||||
|
||||
ENTRYPOINT ["owlbot"]
|
||||
CMD ["--host", "0.0.0.0"]
|
||||
@@ -0,0 +1,16 @@
|
||||
services:
|
||||
owlbot:
|
||||
image: git.logal.dev/logaldeveloper/owlbot:latest
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "8081:8081"
|
||||
volumes:
|
||||
# Copy config.example.yaml to config.yaml and fill in your values.
|
||||
- ./config.yaml:/app/config.yaml:ro
|
||||
# Place custom module files in this directory.
|
||||
- ./modules:/app/modules
|
||||
# Persistent storage for module data.
|
||||
- data:/app/data
|
||||
|
||||
volumes:
|
||||
data:
|
||||
Reference in New Issue
Block a user