forked from llm-d/llm-d-inference-scheduler
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathaction.yml
More file actions
53 lines (50 loc) · 1.63 KB
/
action.yml
File metadata and controls
53 lines (50 loc) · 1.63 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
name: Docker Build - ghcr
description: Build image using buildx
inputs:
docker-file:
required: true
description: Dockerfile name
image-name:
required: true
description: Image name
tag:
required: true
description: Image tag
github-token:
required: true
description: GitHub token for login
registry:
required: true
description: Container registry (e.g., ghcr.io/llm-d)
prerelease:
required: true
description: indicates whether or not this is a pre-release (not a release) build
runs:
using: "composite"
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Login to GitHub Container Registry
run: echo "${{ inputs.github-token }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
shell: bash
- name: Print image info
run: |
echo "Image name: ${{ inputs.image-name }}"
echo "Tag: ${{ inputs.tag }}"
echo "Registry: ${{ inputs.registry }}"
shell: bash
- name: Build image and push
run: |
if [[ ${{ inputs.prerelease }} == "true" ]]; then
LATEST_TAG=""
else
LATEST_TAG="-t ${{ inputs.registry }}/${{ inputs.image-name }}:latest"
fi
docker buildx build \
--platform linux/amd64,linux/arm64 \
--cache-from type=gha,scope=${{ inputs.image-name }} \
--cache-to type=gha,mode=max,scope=${{ inputs.image-name }} \
--build-arg LDFLAGS="-s -w" \
-t ${{ inputs.registry }}/${{ inputs.image-name }}:${{ inputs.tag }} \
${LATEST_TAG} -f ${{ inputs.docker-file }} --push .
shell: bash