Repository navigation
fix(sec): torch.load 默认禁用 pickle 反序列化 - 恶意 .pt/.pth 经 __reduce__ 钩子在加… #3
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: 'Docker 镜像构建' | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - 'v*' # 打 v0.1.0 等标签时自动构建并产出镜像 | |
| permissions: | |
| contents: read | |
| jobs: | |
| docker-build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: '构建 Docker 镜像' | |
| run: | | |
| docker build -t model-translator . | |
| - name: '导出并上传镜像工件' | |
| run: | | |
| docker save model-translator | gzip > model-translator-image.tar.gz | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: 'model-translator-docker-image-${{ github.ref_name }}' | |
| path: 'model-translator-image.tar.gz' | |
| if-no-files-found: 'warn' | |
| retention-days: 14 |