From e04c4fb3999bdff83a565b27b9ce82c2154c305b Mon Sep 17 00:00:00 2001 From: "ekin.tertemiz" Date: Wed, 7 Oct 2026 16:22:31 +0200 Subject: [PATCH] add image_tag variable; improve documentation --- action.yaml | 10 +++++++--- readme.md | 11 ++++++++--- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/action.yaml b/action.yaml index 6c8910c..4525ede 100644 --- a/action.yaml +++ b/action.yaml @@ -1,6 +1,6 @@ name: 'Kaniko Build & Push' -description: 'Builds a multi-stage Dockerfile using Kaniko and pushes it to a container registry' -author: 'Your Name' +description: 'Builds a (multi-stage) Dockerfile using Kaniko and pushes it to container registry' +author: 'tertek' inputs: registry_user: @@ -20,6 +20,10 @@ inputs: destination_image: description: 'The full image name and tag (e.g., my-repo/php-fpm:test)' required: true + image_tag: + description: 'Name of the image tag, appended to the image name with :latest as default' + required: false + default: 'latest' cache_repo: description: 'Custom path for Kaniko cache layers' required: false @@ -57,7 +61,7 @@ runs: --context="dir://${{ forgejo.workspace }}" \ --dockerfile="${{ forgejo.workspace }}/${{ inputs.dockerfile_path }}" \ $TARGET_ARG \ - --destination="$REGISTRY_DOMAIN/${{ inputs.destination_image }}" \ + --destination="$REGISTRY_DOMAIN/${{ inputs.destination_image }}:${{ inputs.image_tag }}" \ --cache=true \ --cache-repo="$CACHE_REPO_ARG" \ --compressed-caching diff --git a/readme.md b/readme.md index cabe897..d1a4cd8 100644 --- a/readme.md +++ b/readme.md @@ -23,6 +23,10 @@ jobs: container: image: ghcr.io/osscontainertools/kaniko:alpine steps: + # Required + - name: Install NodeJS for Action Compatibility + run: apk add --no-cache nodejs + - name: Checkout Source Code uses: actions/checkout@v4 @@ -31,7 +35,8 @@ jobs: with: registry_user: ${{ secrets.REGISTRY_USER }} registry_token: ${{ secrets.REGISTRY_TOKEN }} - dockerfile_path: 'test-1/Dockerfile' - target_stage: 'development' - destination_image: '${{ forgejo.repository }}/foo-image:latest' + dockerfile_path: 'sub-directory/Dockerfile' + target_stage: 'development' # optional + destination_image: '${{ forgejo.repository }}/my-awesome-image' + image_tag: 'latest' # optional ``` \ No newline at end of file