Skip to content

Commit 218dd73

Browse files
authored
ci: Add dockerize workflow. (#8)
Adds a dockerize workflow to allow pulling crpy as an image for easier scripting.
1 parent 883a6e2 commit 218dd73

2 files changed

Lines changed: 32 additions & 2 deletions

File tree

.github/workflows/dockerize.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Build and push Docker image
2+
on:
3+
release:
4+
types: [published]
5+
workflow_dispatch:
6+
jobs:
7+
dockerize:
8+
name: Build and push to GHCR
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
packages: write
13+
steps:
14+
- uses: actions/checkout@v6
15+
- name: Build image
16+
run: |
17+
buildah build \
18+
-t ghcr.io/${{ github.repository }}:$GITHUB_REF_NAME \
19+
-t ghcr.io/${{ github.repository }}:latest .
20+
- name: Push image
21+
run: |
22+
buildah login -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} ghcr.io
23+
buildah push ghcr.io/${{ github.repository }}:$GITHUB_REF_NAME
24+
buildah push ghcr.io/${{ github.repository }}:latest

Dockerfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
FROM python:3.13-slim-bookworm
1+
FROM ghcr.io/astral-sh/uv:python3.14-trixie-slim AS builder
22

33
WORKDIR /app
44
COPY . .
5-
RUN pip install . && pip cache purge && rm -rf /app/*
5+
RUN uv build
6+
7+
FROM python:3.14-slim-trixie
8+
9+
COPY --from=builder /app/dist/*.whl /tmp/
10+
RUN pip install --no-cache-dir /tmp/*.whl && rm /tmp/*.whl
611

712
ENTRYPOINT ["crpy"]
13+
CMD ["--help"]

0 commit comments

Comments
 (0)