-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Build Docker Image | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
paths-ignore: | ||
- 'README.md' | ||
workflow_dispatch: | ||
|
||
env: | ||
GHCR_REPO: ghcr.io/stdioa/beancount-bot | ||
|
||
jobs: | ||
main: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GHCR_PAT }} | ||
|
||
- name: Build and push to GHCR | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/s390x | ||
file: Dockerfile | ||
push: true | ||
tags: | | ||
${{ env.GHCR_REPO }}:latest | ||
${{ env.GHCR_REPO }}:${{ github.sha }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
.DS_Store | ||
.ruff_cache | ||
__pycache__ | ||
tx_db.* | ||
config.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
FROM python:3.11 | ||
|
||
RUN apt-get update && apt-get install -y python3-lxml sqlite3 && \ | ||
pip install --upgrade pip uv && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
|
||
RUN mkdir -p /app | ||
WORKDIR /app | ||
ENV VIRTUAL_ENV=/packages/.venv | ||
RUN mkdir -p $VIRTUAL_ENV && uv venv $VIRTUAL_ENV | ||
COPY requirements-full.txt /app/ | ||
RUN uv pip install --no-cache-dir -r requirements-full.txt | ||
RUN uv pip install --no-cache-dir sqlite-vec=0.1.1 || true | ||
COPY . /app | ||
|
||
VOLUME /data/ledger | ||
WORKDIR /data/ledger | ||
ENTRYPOINT ["/app/entrypoint.sh", "python", "/app/main.py"] | ||
CMD ["telegram"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bash | ||
source $VIRTUAL_ENV/bin/activate | ||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
beancount==2.3.6 | ||
numpy==2.0.1 | ||
fava==1.28 | ||
requests==2.32.3 | ||
pyyaml==6.0.2 | ||
python-telegram-bot==21.4 | ||
mmpy-bot==2.1.4 |