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