diff --git a/.gitea/actions/docker-build/action.yml b/.gitea/actions/docker-build/action.yml index 6f31dab..57fd4b4 100644 --- a/.gitea/actions/docker-build/action.yml +++ b/.gitea/actions/docker-build/action.yml @@ -17,10 +17,19 @@ inputs: default: "" cache-from: description: Cache source (e.g. type=gha, or image:tag) - default: "" + default: type=local,src=/tmp/buildx-cache cache-to: description: Cache destination for buildx (type=gha or type=local) default: type=local,dest=/tmp/buildx-cache,mode=max + registry: + description: Docker registry for login (e.g. ghcr.io) + default: "" + registry-username: + description: Docker registry username + default: "" + registry-password: + description: Docker registry password (use secrets.DOCKER_PASSWORD) + default: "" platforms: description: Target platforms as CSV (e.g. linux/amd64,linux/arm64) default: linux/amd64 @@ -102,6 +111,12 @@ runs: echo "tag=$TAG" >> $GITHUB_OUTPUT echo "tags=$TAGS" >> $GITHUB_OUTPUT + - name: Log in to Docker registry + shell: bash + if: inputs.push == 'true' && inputs.registry != '' + run: | + echo "${{ inputs.registry-password }}" | docker login ${{ inputs.registry }} -u ${{ inputs.registry-username }} --password-stdin + - name: Build image id: build shell: bash