Repository navigation
feat(web): 首页改为服务端渲染并缓存 10 秒 #533
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: | |
| build: | |
| 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: pwsh | |
| run: | | |
| $ErrorActionPreference = 'Stop' | |
| [xml]$xml = Get-Content -Raw 'Directory.Packages.props' | |
| $pg = $xml.Project.PropertyGroup | |
| $versionTemplate = [string]$pg.Version | |
| if ([string]::IsNullOrWhiteSpace($versionTemplate)) { throw 'Version not found in Directory.Packages.props' } | |
| $props = @{} | |
| foreach ($n in $pg.ChildNodes) { | |
| if ($n.NodeType -eq [System.Xml.XmlNodeType]::Element) { | |
| $props[$n.Name] = [string]$n.InnerText | |
| } | |
| } | |
| $props['TimeStamp'] = (Get-Date -AsUTC).ToString('yyyyMMdd') | |
| $unresolved = New-Object System.Collections.Generic.List[string] | |
| $finalVersion = [regex]::Replace($versionTemplate, '\$\(([A-Za-z0-9_.-]+)\)', { | |
| param($m) | |
| $name = $m.Groups[1].Value | |
| if ($props.ContainsKey($name) -and -not [string]::IsNullOrWhiteSpace($props[$name])) { $props[$name] } else { $unresolved.Add($name) | Out-Null; '' } | |
| }) | |
| if ($unresolved.Count -gt 0) { Write-Host "[warn] Unresolved version tokens -> $($unresolved -join ', ')" } | |
| if ([string]::IsNullOrWhiteSpace($finalVersion)) { throw 'Resolved version is empty' } | |
| "version=$finalVersion" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8 | |
| Write-Host "Version template: $versionTemplate" | |
| Write-Host "Final version: $finalVersion" | |
| - 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 | |
| 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 }} | |
| - 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 | |
| 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 }} |