File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Publish Docker Image
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ tags :
8+ - ' v*'
9+ workflow_dispatch :
10+
11+ env :
12+ REGISTRY : ghcr.io
13+ IMAGE_NAME : ${{ github.repository }}
14+
15+ jobs :
16+ build-and-push-image :
17+ runs-on : ubuntu-latest
18+ permissions :
19+ contents : read
20+ packages : write
21+
22+ steps :
23+ - name : Checkout repository
24+ uses : actions/checkout@v4
25+
26+ - name : Log in to the Container registry
27+ uses : docker/login-action@v3
28+ with :
29+ registry : ${{ env.REGISTRY }}
30+ username : ${{ github.actor }}
31+ password : ${{ secrets.GITHUB_TOKEN }}
32+
33+ - name : Extract metadata (tags, labels) for Docker
34+ id : meta
35+ uses : docker/metadata-action@v5
36+ with :
37+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
38+ tags : |
39+ type=ref,event=branch
40+ type=semver,pattern={{version}}
41+ type=semver,pattern={{major}}.{{minor}}
42+
43+ - name : Set up Docker Buildx
44+ uses : docker/setup-buildx-action@v3
45+
46+ - name : Build and push Docker image
47+ uses : docker/build-push-action@v5
48+ with :
49+ context : .
50+ push : true
51+ tags : ${{ steps.meta.outputs.tags }}
52+ labels : ${{ steps.meta.outputs.labels }}
53+ cache-from : type=gha
54+ cache-to : type=gha,mode=max
Original file line number Diff line number Diff line change 1+ FROM python:3.11-slim-bookworm
2+
3+ ENV PYTHONDONTWRITEBYTECODE=1
4+ ENV PYTHONUNBUFFERED=1
5+
6+ RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/*
7+
8+ WORKDIR /app
9+
10+ COPY pyproject.toml README.md ./
11+ COPY doc_engine/ ./doc_engine/
12+
13+ RUN pip install --no-cache-dir .
14+
15+ WORKDIR /workspace
16+
17+ ENTRYPOINT ["python" , "-m" , "doc_engine" ]
18+
19+ CMD ["build" ]
You can’t perform that action at this time.
0 commit comments