@@ -13,27 +13,52 @@ inputs:
1313 registry :
1414 required : true
1515 description : Container registry (e.g., ghcr.io/llm-d)
16+ context :
17+ required : false
18+ description : Build context path (defaults to repository root)
19+ default : ' .'
20+ dockerfile :
21+ required : false
22+ description : Path to Dockerfile relative to context (defaults to Dockerfile in context)
23+ default : ' '
1624runs :
1725 using : " composite"
1826 steps :
1927 - name : Set up Docker Buildx
2028 uses : docker/setup-buildx-action@v3
2129
2230 - name : Login to GitHub Container Registry
23- run : echo "${{ inputs.github-token }} " | docker login ghcr.io -u ${{ github.actor }} --password-stdin
31+ run : echo "${GITHUB_TOKEN} " | docker login ghcr.io -u "${GITHUB_ACTOR}" --password-stdin
2432 shell : bash
33+ env :
34+ GITHUB_TOKEN : ${{ inputs.github-token }}
2535
2636 - name : Print image info
2737 run : |
28- echo "Image name: ${{ inputs.image-name } }"
29- echo "Tag: ${{ inputs.tag } }"
30- echo "Registry: ${{ inputs.registry } }"
38+ echo "Image name: ${IMAGE_NAME }"
39+ echo "Tag: ${TAG }"
40+ echo "Registry: ${REGISTRY }"
3141 shell : bash
42+ env :
43+ IMAGE_NAME : ${{ inputs.image-name }}
44+ TAG : ${{ inputs.tag }}
45+ REGISTRY : ${{ inputs.registry }}
3246
3347 - name : Build image and push
3448 run : |
49+ DOCKERFILE_ARG=""
50+ if [ -n "${DOCKERFILE}" ]; then
51+ DOCKERFILE_ARG="-f ${DOCKERFILE}"
52+ fi
3553 docker buildx build \
3654 --platform linux/amd64 \
37- -t ${{ inputs.registry }}/${{ inputs.image-name }}:${{ inputs.tag }} \
38- --push .
55+ ${DOCKERFILE_ARG} \
56+ -t "${REGISTRY}/${IMAGE_NAME}:${TAG}" \
57+ --push "${CONTEXT}"
3958 shell : bash
59+ env :
60+ DOCKERFILE : ${{ inputs.dockerfile }}
61+ REGISTRY : ${{ inputs.registry }}
62+ IMAGE_NAME : ${{ inputs.image-name }}
63+ TAG : ${{ inputs.tag }}
64+ CONTEXT : ${{ inputs.context }}
0 commit comments