Repository navigation
chore: 关闭全局 API 限流,避免正常请求触发 429 #551
This file contains hidden or 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
| name: Build and Push Docker Images | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [ main ] | |
| jobs: | |
| # 后端与前端镜像并行构建,互不阻塞 | |
| backend: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Docker Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: crpi-j9ha7sxwhatgtvj4.cn-shenzhen.personal.cr.aliyuncs.com | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Extract version from Directory.Packages.props | |
| id: get_version | |
| shell: bash | |
| run: | | |
| version="$(sed -n 's/.*<Version>\(.*\)<\/Version>.*/\1/p' Directory.Packages.props | head -1 | tr -d '[:space:]')" | |
| if [ -z "$version" ]; then | |
| echo "Version not found in Directory.Packages.props" >&2 | |
| exit 1 | |
| fi | |
| case "$version" in | |
| *'$('*) | |
| echo "Unresolved version token in template: $version" >&2 | |
| exit 1 | |
| ;; | |
| esac | |
| echo "version=$version" >> "$GITHUB_OUTPUT" | |
| echo "Final version: $version" | |
| - name: Build and push opendeepwiki | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: src/OpenDeepWiki/Dockerfile | |
| platforms: linux/amd64 | |
| push: true | |
| provenance: false | |
| sbom: false | |
| # GHA 层缓存:apt/pip、restore、编译层在多次构建间复用 | |
| # scope 与 release.yml 保持一致,可跨 workflow 共享缓存 | |
| cache-from: type=gha,scope=backend | |
| cache-to: type=gha,mode=max,scope=backend | |
| tags: | | |
| crpi-j9ha7sxwhatgtvj4.cn-shenzhen.personal.cr.aliyuncs.com/open-deepwiki/opendeepwiki:latest | |
| crpi-j9ha7sxwhatgtvj4.cn-shenzhen.personal.cr.aliyuncs.com/open-deepwiki/opendeepwiki:${{ steps.get_version.outputs.version }} | |
| web: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Docker Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: crpi-j9ha7sxwhatgtvj4.cn-shenzhen.personal.cr.aliyuncs.com | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Extract version from Directory.Packages.props | |
| id: get_version | |
| shell: bash | |
| run: | | |
| version="$(sed -n 's/.*<Version>\(.*\)<\/Version>.*/\1/p' Directory.Packages.props | head -1 | tr -d '[:space:]')" | |
| if [ -z "$version" ]; then | |
| echo "Version not found in Directory.Packages.props" >&2 | |
| exit 1 | |
| fi | |
| case "$version" in | |
| *'$('*) | |
| echo "Unresolved version token in template: $version" >&2 | |
| exit 1 | |
| ;; | |
| esac | |
| echo "version=$version" >> "$GITHUB_OUTPUT" | |
| echo "Final version: $version" | |
| - name: Build and push opendeepwiki-web | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: ./web | |
| file: ./web/Dockerfile | |
| platforms: linux/amd64 | |
| push: true | |
| provenance: false | |
| sbom: false | |
| cache-from: type=gha,scope=web | |
| cache-to: type=gha,mode=max,scope=web | |
| tags: | | |
| crpi-j9ha7sxwhatgtvj4.cn-shenzhen.personal.cr.aliyuncs.com/open-deepwiki/opendeepwiki-web:latest | |
| crpi-j9ha7sxwhatgtvj4.cn-shenzhen.personal.cr.aliyuncs.com/open-deepwiki/opendeepwiki-web:${{ steps.get_version.outputs.version }} |