Skip to content

Commit 1dae3d6

Browse files
author
LazyFP Dev
committed
docs: bilingual README, update Dockerfile, .gitignore, .dockerignore, add GitHub Actions
1 parent 03cfc2d commit 1dae3d6

5 files changed

Lines changed: 299 additions & 51 deletions

File tree

.dockerignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
__pycache__
1+
__pycache__/
22
*.pyc
33
*.pyo
44
.venv/
55
.venv
66
.git/
7-
.github/
87
.vscode/
98
.idea/
109
tests/
11-
*.md
1210
.env
1311
*.log
1412
.DS_Store
1513
invoice_cache.json
1614
invoice_summary.xlsx
1715
fp/dump/
1816
fp/organized/
17+
fp/*.pdf
18+
*.md
19+
!README.md

.github/workflows/docker.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Build and Push Docker Image
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
tags: [ 'v*' ]
7+
pull_request:
8+
branches: [ main ]
9+
10+
env:
11+
REGISTRY: ghcr.io
12+
IMAGE_NAME: ${{ github.repository }}
13+
14+
jobs:
15+
build-and-push:
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
19+
packages: write
20+
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
25+
- name: Set up QEMU
26+
uses: docker/setup-qemu-action@v3
27+
28+
- name: Set up Docker Buildx
29+
uses: docker/setup-buildx-action@v3
30+
31+
- name: Log in to Container Registry
32+
if: github.event_name != 'pull_request'
33+
uses: docker/login-action@v3
34+
with:
35+
registry: ${{ env.REGISTRY }}
36+
username: ${{ github.actor }}
37+
password: ${{ secrets.GITHUB_TOKEN }}
38+
39+
- name: Extract metadata
40+
id: meta
41+
uses: docker/metadata-action@v5
42+
with:
43+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
44+
tags: |
45+
type=ref,event=branch
46+
type=semver,pattern={{version}}
47+
type=semver,pattern={{major}}.{{minor}}
48+
type=sha
49+
50+
- name: Build and push Docker image
51+
uses: docker/build-push-action@v5
52+
with:
53+
context: .
54+
push: ${{ github.event_name != 'pull_request' }}
55+
tags: ${{ steps.meta.outputs.tags }}
56+
labels: ${{ steps.meta.outputs.labels }}
57+
cache-from: type=gha
58+
cache-to: type=gha,mode=max

.gitignore

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,35 @@
1+
# Python
12
__pycache__/
2-
venv/
3-
*.log
43
*.pyc
4+
*.pyo
5+
*.egg-info/
6+
dist/
7+
build/
8+
9+
# Virtual environments
10+
.venv/
11+
venv/
12+
13+
# IDE
14+
.vscode/
15+
.idea/
16+
*.swp
17+
*.swo
18+
19+
# OS
520
.DS_Store
21+
Thumbs.db
22+
23+
# Environment
624
.env
25+
*.log
726

827
# Data and Outputs
9-
fp/
10-
zip/
28+
fp/dump/
29+
fp/organized/
30+
fp/*.pdf
1131
invoice_cache.json
1232
invoice_summary.xlsx
13-
debug_output.txt
33+
34+
# Lock files (keep pyproject.toml, ignore uv.lock for portability)
35+
uv.lock

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ RUN pip install --no-cache-dir -r requirements.txt
1212

1313
COPY . .
1414

15-
RUN mkdir -p fp/dump fp/organized static config
15+
RUN mkdir -p fp/dump fp/organized
1616

1717
EXPOSE 8000
1818

0 commit comments

Comments
 (0)