1+ name : Build and Push Deploy Images
2+
3+ on :
4+ push :
5+ branches : [ main, master ]
6+ paths :
7+ - ' src/**'
8+ - ' docker/RK3576/VLM/deploy_llm.dockerfile'
9+ - ' docker/RK3576/LLM/deploy_llm.dockerfile'
10+ - ' docker/RK3588/VLM/deploy_vlm.dockerfile'
11+ - ' docker/RK3588/LLM/deploy_llm.dockerfile'
12+ - ' .github/workflows/deploy.yml'
13+ - ' lib/**'
14+ workflow_dispatch :
15+
16+ permissions :
17+ contents : read
18+ packages : write
19+
20+ jobs :
21+ build :
22+ runs-on : ubuntu-latest
23+ strategy :
24+ matrix :
25+ include :
26+ - platform : rk3576
27+ type : llm
28+ dockerfile : docker/RK3576/LLM/deploy_llm.dockerfile
29+ - platform : rk3576
30+ type : vlm
31+ dockerfile : docker/RK3576/VLM/deploy_vlm.dockerfile
32+ - platform : rk3588
33+ type : llm
34+ dockerfile : docker/RK3588/LLM/deploy_llm.dockerfile
35+ - platform : rk3588
36+ type : vlm
37+ dockerfile : docker/RK3588/VLM/deploy_vlm.dockerfile
38+
39+ steps :
40+ - name : Checkout repository
41+ uses : actions/checkout@v4
42+
43+ - name : Set up QEMU (for ARM64 emulation)
44+ uses : docker/setup-qemu-action@v3
45+
46+ - name : Set up Docker Buildx
47+ uses : docker/setup-buildx-action@v3
48+
49+ - name : Log in to GHCR
50+ uses : docker/login-action@v3
51+ with :
52+ registry : ghcr.io
53+ username : ${{ github.actor }}
54+ password : ${{ secrets.GITHUB_TOKEN }}
55+
56+ # Generate image tags:
57+ # Image name: ghcr.io/<owner>/deploy_<type>
58+ # Tags: <platform>-latest, <platform>-<short-sha>
59+ - name : Generate image tags
60+ id : meta
61+ run : |
62+ OWNER_LOWER=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
63+ IMAGE_NAME="ghcr.io/${OWNER_LOWER}/deploy_${{ matrix.type }}"
64+ SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-7)
65+ TAGS="${IMAGE_NAME}:${{ matrix.platform }}-latest"
66+ TAGS="${TAGS},${IMAGE_NAME}:${{ matrix.platform }}-${SHORT_SHA}"
67+ echo "tags=${TAGS}" >> $GITHUB_OUTPUT
68+
69+ - name : Build and push Docker image
70+ uses : docker/build-push-action@v5
71+ with :
72+ context : .
73+ file : ${{ matrix.dockerfile }}
74+ platforms : linux/arm64
75+ push : ${{ github.event_name != 'pull_request' }}
76+ tags : ${{ steps.meta.outputs.tags }}
77+ labels : |
78+ org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
79+ org.opencontainers.image.revision=${{ github.sha }}
80+ org.opencontainers.image.version=${{ github.ref_name }}
0 commit comments