| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- # 自动构建并推送 GHCR:push master 触发
- # 镜像 tag:latest + 日期时间 - 提交哈希(如 20260815T0054-a1b2c3d)
- #
- # Auto-build and push to GHCR: triggered on push to master
- # Image tags: latest + datetime-commit-hash (e.g. 20260815T0054-a1b2c3d)
- name: build-push-ghcr
- on:
- push:
- branches: [master]
- env:
- IMAGE: ghcr.io/xidong-ai/deepseek-harness-web-docker
- jobs:
- build:
- runs-on: ubuntu-latest
- permissions:
- contents: read
- packages: write
- steps:
- - uses: actions/checkout@v4
- - name: Set up QEMU
- uses: docker/setup-qemu-action@v3
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v3
- - name: Log in to GHCR
- uses: docker/login-action@v3
- with:
- registry: ghcr.io
- username: ${{ github.actor }}
- password: ${{ secrets.GITHUB_TOKEN }}
- - name: 生成日期时间 - 哈希 tag
- id: meta
- run: |
- echo "tag=$(date +%Y%m%dT%H%M)-${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
- - name: Build and push
- uses: docker/build-push-action@v6
- with:
- context: .
- push: true
- platforms: linux/amd64,linux/arm64
- tags: |
- ${{ env.IMAGE }}:latest
- ${{ env.IMAGE }}:${{ steps.meta.outputs.tag }}
|