chore: Update .dockerignore and GitHub Actions for improved caching
This commit is contained in:
+74
-1
@@ -1,2 +1,75 @@
|
|||||||
|
# VCS / CI
|
||||||
|
.git/
|
||||||
|
.github/
|
||||||
|
.gitignore
|
||||||
|
.gitattributes
|
||||||
|
|
||||||
|
# 编辑器 / IDE 本地配置
|
||||||
|
.cursor/
|
||||||
|
.claude/
|
||||||
|
.codebuddy/
|
||||||
|
.vscode/
|
||||||
|
.idea/
|
||||||
|
*.swp
|
||||||
|
*.swo
|
||||||
|
.DS_Store
|
||||||
|
|
||||||
|
# Python 虚拟环境 / 缓存
|
||||||
**/.venv/
|
**/.venv/
|
||||||
**/.python-version
|
.venv_proto/
|
||||||
|
**/.python-version
|
||||||
|
**/__pycache__/
|
||||||
|
**/*.pyc
|
||||||
|
|
||||||
|
# Node / 前端
|
||||||
|
# 注意:build-ui 用的 context 是 ./frontend,根 .dockerignore 对它无效,
|
||||||
|
# 其它镜像(app/docreader/sandbox)的 Dockerfile 都不引用 frontend/,
|
||||||
|
# 所以这里可以直接排除整个 frontend/ 目录。
|
||||||
|
**/node_modules/
|
||||||
|
frontend/
|
||||||
|
WeKnora-Chrome-Extension/
|
||||||
|
|
||||||
|
# 日志 / 临时文件
|
||||||
|
logs/
|
||||||
|
tmp/
|
||||||
|
temp/
|
||||||
|
*.log
|
||||||
|
*.pid
|
||||||
|
|
||||||
|
# 本地构建产物 / 二进制
|
||||||
|
WeKnora
|
||||||
|
WeKnora-lite
|
||||||
|
/server
|
||||||
|
/dist/
|
||||||
|
/build/
|
||||||
|
cmd/desktop/build/bin/
|
||||||
|
|
||||||
|
# 本地数据 / 模型文件
|
||||||
|
/models/
|
||||||
|
data/files/
|
||||||
|
data/*.db
|
||||||
|
data/*.db-wal
|
||||||
|
data/*.db-shm
|
||||||
|
test/data/mswag.txt
|
||||||
|
|
||||||
|
# 敏感文件
|
||||||
|
.env
|
||||||
|
.env.lite
|
||||||
|
*.pem
|
||||||
|
*.key
|
||||||
|
*.crt
|
||||||
|
*_key
|
||||||
|
*_secret
|
||||||
|
|
||||||
|
# 大的归档/压缩包
|
||||||
|
packages/protoc-*.zip
|
||||||
|
|
||||||
|
# 本地测试脚本
|
||||||
|
configure-ollama.sh
|
||||||
|
fix-docker.sh
|
||||||
|
/scripts/scale_dev_jobs.sh
|
||||||
|
|
||||||
|
# 文档(不影响构建)
|
||||||
|
docs/
|
||||||
|
*.md
|
||||||
|
!README.md
|
||||||
|
|||||||
@@ -41,8 +41,8 @@ jobs:
|
|||||||
context: ./frontend
|
context: ./frontend
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
cache-from: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/weknora-ui:cache
|
cache-from: type=gha,scope=build-ui
|
||||||
cache-to: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/weknora-ui:cache,mode=max
|
cache-to: type=gha,scope=build-ui,mode=max
|
||||||
|
|
||||||
build-docreader:
|
build-docreader:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -90,8 +90,8 @@ jobs:
|
|||||||
context: .
|
context: .
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
cache-from: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/weknora-docreader:cache
|
cache-from: type=gha,scope=build-docreader
|
||||||
cache-to: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/weknora-docreader:cache,mode=max
|
cache-to: type=gha,scope=build-docreader,mode=max
|
||||||
|
|
||||||
build-sandbox:
|
build-sandbox:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -123,8 +123,8 @@ jobs:
|
|||||||
context: .
|
context: .
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
cache-from: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/weknora-sandbox:cache
|
cache-from: type=gha,scope=build-sandbox
|
||||||
cache-to: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/weknora-sandbox:cache,mode=max
|
cache-to: type=gha,scope=build-sandbox,mode=max
|
||||||
|
|
||||||
build-app:
|
build-app:
|
||||||
strategy:
|
strategy:
|
||||||
@@ -187,8 +187,8 @@ jobs:
|
|||||||
${{ format('GO_VERSION_ARG={0}', steps.version.outputs.go_version) }}
|
${{ format('GO_VERSION_ARG={0}', steps.version.outputs.go_version) }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
tags: ${{ secrets.DOCKERHUB_USERNAME }}/weknora-app
|
tags: ${{ secrets.DOCKERHUB_USERNAME }}/weknora-app
|
||||||
cache-from: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/weknora-app:cache-${{ env.PLATFORM_PAIR }}
|
cache-from: type=gha,scope=build-app-${{ env.PLATFORM_PAIR }}
|
||||||
cache-to: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/weknora-app:cache-${{ env.PLATFORM_PAIR }},mode=max
|
cache-to: type=gha,scope=build-app-${{ env.PLATFORM_PAIR }},mode=max
|
||||||
outputs: type=image,push-by-digest=true,name-canonical=true,push=true
|
outputs: type=image,push-by-digest=true,name-canonical=true,push=true
|
||||||
|
|
||||||
- name: Export digest
|
- name: Export digest
|
||||||
|
|||||||
Reference in New Issue
Block a user