Merge pull request #10 from LJ-Hao/main #1
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: 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 }} |