diff --git a/.gitea/actions/docker/README.md b/.gitea/actions/docker/README.md index fba6a89..aefd183 100644 --- a/.gitea/actions/docker/README.md +++ b/.gitea/actions/docker/README.md @@ -20,6 +20,7 @@ Build a Docker image and push it to the Gitea container registry | `ARTIFACT_NAME` |

Name of the build artifact to download

| `false` | `dist` | | `ARTIFACT_PATH` |

Destination path for the downloaded artifact

| `false` | `dist` | | `TAG_LATEST` |

Also tag and push the image as latest

| `false` | `false` | +| `WORKING_DIRECTORY` |

Working directory for the Docker build

| `false` | `.` | diff --git a/.gitea/actions/docker/action.yml b/.gitea/actions/docker/action.yml index 3275052..44b632b 100644 --- a/.gitea/actions/docker/action.yml +++ b/.gitea/actions/docker/action.yml @@ -28,6 +28,9 @@ inputs: TAG_LATEST: description: "Also tag and push the image as latest" default: "false" + WORKING_DIRECTORY: + description: "Working directory for the Docker build" + default: "." runs: using: composite @@ -52,7 +55,7 @@ runs: if [ "${{ inputs.TAG_LATEST }}" = "true" ]; then TAGS="$TAGS -t ${{ inputs.IMAGE_PATH }}:latest" fi - docker buildx build -f Dockerfile . \ + docker buildx build -f ${{ inputs.WORKING_DIRECTORY }}/Dockerfile ${{ inputs.WORKING_DIRECTORY }} \ --platform ${{ inputs.PLATFORMS }} \ --push \ $TAGS