Spaces:
Running on Zero
Running on Zero
Download .github/workflows/docker.yaml from donotthink/meme: direct link, hf CLI and curl.
- Browser
- Download file 1.67 kB
-
https://huggingface.co/spaces/donotthink/meme/resolve/main/.github/workflows/docker.yaml
- Command line
-
hf download hf://spaces/donotthink/meme/.github/workflows/docker.yaml
-
curl -L -o docker.yaml https://huggingface.co/spaces/donotthink/meme/resolve/main/.github/workflows/docker.yaml
1.67 kB
| name: 构建并推送镜像 | |
| on: | |
| push: | |
| branches: | |
| - "main" | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 检出代码 | |
| uses: actions/checkout@v4 | |
| - name: 登录 Docker 镜像仓库 | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: 登陆 GitHub 镜像仓库 | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: 生成镜像元数据 | |
| id: meta | |
| uses: docker/metadata-action@v4 | |
| with: | |
| images: | | |
| docker.io/${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }} | |
| ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }} | |
| tags: | | |
| type=ref,event=branch | |
| type=semver,pattern={{version}},prefix=v | |
| type=semver,pattern=latest,enable={{is_default_branch}} | |
| - name: 设置 QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: 设置 Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: 构建并推送 Docker 镜像 | |
| uses: docker/build-push-action@v5 | |
| with: | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |