From 12d1a7b7373c3034c441acc2ec8f6e12c0c7b11c Mon Sep 17 00:00:00 2001 From: Dan Haman Date: Mon, 28 Sep 2026 21:00:25 +0300 Subject: [PATCH 1/8] #7: Docker build command + action skeleton added --- docker/task.yaml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 docker/task.yaml diff --git a/docker/task.yaml b/docker/task.yaml new file mode 100644 index 0000000..7d8494b --- /dev/null +++ b/docker/task.yaml @@ -0,0 +1,23 @@ +name: build & push +description: build & push OCI container images to the Gitea registry + +inputs: + name: + description: image name + required: true + tags: + description: newline-separated list of tags to tag the image + required: true + +runs: + using: composite + steps: + - shell: bash + run: | + docker login --username acti-bot --password ${ACTI_BOT_TOKEN} ${{ gitea.server_url }} + while IFS= read -r tag; do + [[ -z "$tag" ]] && continue + + docker build -f Containerfile -t "${{ gitea.server_url }}/${{ gitea.repository }}/${{ inputs.name }}:$tag" + docker push "${{ gitea.server_url }}/${{ gitea.repository }}/${{ inputs.name }}:$tag" + done <<< "${{ inputs.tags }}" From 5bd2aaa7a9b35283563bbb0a21b761beea0c416d Mon Sep 17 00:00:00 2001 From: Dan Haman Date: Mon, 28 Sep 2026 21:03:43 +0300 Subject: [PATCH 2/8] #7: Docker build command + typo fixed --- docker/{task.yaml => action.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docker/{task.yaml => action.yaml} (100%) diff --git a/docker/task.yaml b/docker/action.yaml similarity index 100% rename from docker/task.yaml rename to docker/action.yaml From 184358025f0dff449a707e4be733979b085a4e8d Mon Sep 17 00:00:00 2001 From: Dan Haman Date: Mon, 28 Sep 2026 21:27:28 +0300 Subject: [PATCH 3/8] #7: Docker build command + url refernce updated --- docker/action.yaml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/docker/action.yaml b/docker/action.yaml index 7d8494b..c47f2f4 100644 --- a/docker/action.yaml +++ b/docker/action.yaml @@ -14,10 +14,14 @@ runs: steps: - shell: bash run: | - docker login --username acti-bot --password ${ACTI_BOT_TOKEN} ${{ gitea.server_url }} + repo_url="${{ gitea.repositoryUrl }}" + repo_host="${repo_url#https://}" + repo_host="${repo_host%%/*}" + docker login --username acti-bot --password ${ACTI_BOT_TOKEN} ${repo_host} while IFS= read -r tag; do [[ -z "$tag" ]] && continue - docker build -f Containerfile -t "${{ gitea.server_url }}/${{ gitea.repository }}/${{ inputs.name }}:$tag" - docker push "${{ gitea.server_url }}/${{ gitea.repository }}/${{ inputs.name }}:$tag" + image="${repo_host}/${{ gitea.repository }}/${{ inputs.name }}:$tag" + docker build -f Containerfile -t $image + docker push $image done <<< "${{ inputs.tags }}" From 31379026f3ed73d3593230aef4b077c65d04759a Mon Sep 17 00:00:00 2001 From: Dan Haman Date: Mon, 28 Sep 2026 21:31:51 +0300 Subject: [PATCH 4/8] #7: Docker build command + url refernce updated --- docker/action.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker/action.yaml b/docker/action.yaml index c47f2f4..677c95d 100644 --- a/docker/action.yaml +++ b/docker/action.yaml @@ -14,7 +14,8 @@ runs: steps: - shell: bash run: | - repo_url="${{ gitea.repositoryUrl }}" + echo ${GITHUB_SERVER_URL} ${GITHUB_API_URL} ${{ gitea.event.repository.html_url }} ${{ gitea.api_url }} ${{ gitea.repositoryUrl }} ${{ gitea.server_url }} + repo_url="${GITHUB_SERVER_URL}" repo_host="${repo_url#https://}" repo_host="${repo_host%%/*}" docker login --username acti-bot --password ${ACTI_BOT_TOKEN} ${repo_host} From d6f55c70cb67fba87617ee3a0402a5b9003de7ab Mon Sep 17 00:00:00 2001 From: Dan Haman Date: Mon, 28 Sep 2026 21:33:08 +0300 Subject: [PATCH 5/8] #7: Docker build command + url refernce updated --- docker/action.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docker/action.yaml b/docker/action.yaml index 677c95d..cdfce0d 100644 --- a/docker/action.yaml +++ b/docker/action.yaml @@ -14,8 +14,7 @@ runs: steps: - shell: bash run: | - echo ${GITHUB_SERVER_URL} ${GITHUB_API_URL} ${{ gitea.event.repository.html_url }} ${{ gitea.api_url }} ${{ gitea.repositoryUrl }} ${{ gitea.server_url }} - repo_url="${GITHUB_SERVER_URL}" + repo_url="${{ gitea.event.repository.html_url }}" repo_host="${repo_url#https://}" repo_host="${repo_host%%/*}" docker login --username acti-bot --password ${ACTI_BOT_TOKEN} ${repo_host} From 436e40d2cad8efdd945261fd43a797b3b43126a1 Mon Sep 17 00:00:00 2001 From: Dan Haman Date: Mon, 28 Sep 2026 21:49:37 +0300 Subject: [PATCH 6/8] #7: Docker build command + build context fixed + variable containerfile name support --- docker/action.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docker/action.yaml b/docker/action.yaml index cdfce0d..50fc949 100644 --- a/docker/action.yaml +++ b/docker/action.yaml @@ -8,6 +8,10 @@ inputs: tags: description: newline-separated list of tags to tag the image required: true + containerfile: + description: target container file to build + required: false + default: Containerfile runs: using: composite @@ -22,6 +26,6 @@ runs: [[ -z "$tag" ]] && continue image="${repo_host}/${{ gitea.repository }}/${{ inputs.name }}:$tag" - docker build -f Containerfile -t $image + docker build -f ${{ containerfile }} -t $image . docker push $image done <<< "${{ inputs.tags }}" From 06b262de81a437aaf0e45c59cebf06edaa35ea3a Mon Sep 17 00:00:00 2001 From: Dan Haman Date: Mon, 28 Sep 2026 21:53:37 +0300 Subject: [PATCH 7/8] #7: Docker build command + containerfile variable fixed --- docker/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/action.yaml b/docker/action.yaml index 50fc949..66e0529 100644 --- a/docker/action.yaml +++ b/docker/action.yaml @@ -26,6 +26,6 @@ runs: [[ -z "$tag" ]] && continue image="${repo_host}/${{ gitea.repository }}/${{ inputs.name }}:$tag" - docker build -f ${{ containerfile }} -t $image . + docker build -f ${{ inputs.containerfile }} -t $image . docker push $image done <<< "${{ inputs.tags }}" From b34fa35ec721b7373b734e578318a4ae2b768bfa Mon Sep 17 00:00:00 2001 From: Dan Haman Date: Mon, 28 Sep 2026 23:36:42 +0300 Subject: [PATCH 8/8] #7: Docker build command + building improved --- docker/action.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docker/action.yaml b/docker/action.yaml index 66e0529..ef383b8 100644 --- a/docker/action.yaml +++ b/docker/action.yaml @@ -22,10 +22,12 @@ runs: repo_host="${repo_url#https://}" repo_host="${repo_host%%/*}" docker login --username acti-bot --password ${ACTI_BOT_TOKEN} ${repo_host} + + docker build -f ${{ inputs.containerfile }} -t img-${{ gitea.run_id }} . while IFS= read -r tag; do [[ -z "$tag" ]] && continue image="${repo_host}/${{ gitea.repository }}/${{ inputs.name }}:$tag" - docker build -f ${{ inputs.containerfile }} -t $image . + docker tag img-${{ gitea.run_id }} $image docker push $image done <<< "${{ inputs.tags }}"