From 7ca49447eda359448ec909ca5b04ed820d5faa88 Mon Sep 17 00:00:00 2001 From: Stefan Kuhn Date: Mon, 16 Mar 2026 15:44:20 +0000 Subject: [PATCH 1/3] Make workflow image name overrideable from Actions vars Keep nikolaik/python-nodejs as the default image name in the workflow, but resolve it through a GitHub Actions variable so forks can publish to a different image without changing the repository. Forks can set IMAGE_NAME in Actions variables or in workflow run configuration. That keeps the default behavior unchanged here while avoiding fork-specific edits in PRs. --- .github/workflows/build.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f1a548e..817c001 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -6,6 +6,9 @@ on: schedule: - cron: "0 00,12 * * *" # Twice a day +env: + IMAGE_NAME: ${{ vars.IMAGE_NAME || 'nikolaik/python-nodejs' }} + jobs: generate-matrix: name: Generate build matrix @@ -59,12 +62,12 @@ jobs: context: . file: dockerfiles/${{ matrix.key }}.Dockerfile load: true - tags: nikolaik/python-nodejs:${{ matrix.key }} + tags: ${{ env.IMAGE_NAME }}:${{ matrix.key }} # Test - name: Run smoke tests run: | - docker run --rm nikolaik/python-nodejs:${{ matrix.key }} sh -c "node --version && npm --version && yarn --version && python --version && pip --version && pipenv --version && poetry --version && uv --version" + docker run --rm ${{ env.IMAGE_NAME }}:${{ matrix.key }} sh -c "node --version && npm --version && yarn --version && python --version && pip --version && pipenv --version && poetry --version && uv --version" # Push image - name: Push image @@ -75,7 +78,7 @@ jobs: file: dockerfiles/${{ matrix.key }}.Dockerfile platforms: ${{ join(matrix.platforms) }} push: true - tags: nikolaik/python-nodejs:${{ matrix.key }} + tags: ${{ env.IMAGE_NAME }}:${{ matrix.key }} # Store build context - name: Add digest to build context From e59a27ece5c8fa56bc2039d6ca195662b7b1de57 Mon Sep 17 00:00:00 2001 From: Stefan Kuhn Date: Mon, 16 Mar 2026 17:27:07 +0000 Subject: [PATCH 2/3] Add manual deploy trigger with run-time overrides Allow manual workflow runs from GitHub Actions with a force option and an optional IMAGE_NAME override. This makes it possible to test publish flows without overwriting the real published images tags. --- .github/workflows/build.yaml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 817c001..2e5ad62 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -5,9 +5,21 @@ on: branches: [main] schedule: - cron: "0 00,12 * * *" # Twice a day + workflow_dispatch: + inputs: + force: + description: Force rebuild and republish all image tags + required: false + default: true + type: boolean + image_name: + description: Override image name for this manual run + required: false + default: "" + type: string env: - IMAGE_NAME: ${{ vars.IMAGE_NAME || 'nikolaik/python-nodejs' }} + IMAGE_NAME: ${{ inputs.image_name || vars.IMAGE_NAME || 'nikolaik/python-nodejs' }} jobs: generate-matrix: @@ -26,7 +38,7 @@ jobs: - name: Generate build matrix id: set-matrix run: | - FORCE=$(if git log --pretty=format:"%s" HEAD^..HEAD | grep -q '\[force\]'; then echo "--force"; else echo ""; fi) + FORCE=$(if [[ "${{ github.event_name }}" == "workflow_dispatch" && "${{ inputs.force }}" == "true" ]]; then echo "--force"; elif git log --pretty=format:"%s" HEAD^..HEAD | grep -q '\[force\]'; then echo "--force"; else echo ""; fi) uv run dpn $FORCE build-matrix --event ${{ github.event_name }} From 5dfaea967ed562e6a0bffee6048a7f6d8537462c Mon Sep 17 00:00:00 2001 From: Stefan Kuhn Date: Wed, 18 Mar 2026 11:08:09 +0100 Subject: [PATCH 3/3] Refine build workflow inputs and shell formatting Address review feedback on PR #373 by renaming the manual image override input and reformatting long shell commands for readability. --- .github/workflows/build.yaml | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 2e5ad62..5ca7f7c 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -9,17 +9,15 @@ on: inputs: force: description: Force rebuild and republish all image tags - required: false default: true type: boolean - image_name: + image-name: description: Override image name for this manual run - required: false default: "" type: string env: - IMAGE_NAME: ${{ inputs.image_name || vars.IMAGE_NAME || 'nikolaik/python-nodejs' }} + IMAGE_NAME: ${{ inputs.image-name || vars.IMAGE_NAME || 'nikolaik/python-nodejs' }} jobs: generate-matrix: @@ -38,7 +36,12 @@ jobs: - name: Generate build matrix id: set-matrix run: | - FORCE=$(if [[ "${{ github.event_name }}" == "workflow_dispatch" && "${{ inputs.force }}" == "true" ]]; then echo "--force"; elif git log --pretty=format:"%s" HEAD^..HEAD | grep -q '\[force\]'; then echo "--force"; else echo ""; fi) + FORCE= + if [[ "${{ github.event_name }}" == "workflow_dispatch" && "${{ inputs.force }}" == "true" ]]; then + FORCE="--force" + elif git log --pretty=format:"%s" HEAD^..HEAD | grep -q '\[force\]'; then + FORCE="--force" + fi uv run dpn $FORCE build-matrix --event ${{ github.event_name }} @@ -79,7 +82,10 @@ jobs: # Test - name: Run smoke tests run: | - docker run --rm ${{ env.IMAGE_NAME }}:${{ matrix.key }} sh -c "node --version && npm --version && yarn --version && python --version && pip --version && pipenv --version && poetry --version && uv --version" + docker run --rm ${{ env.IMAGE_NAME }}:${{ matrix.key }} sh -c \ + "node --version && npm --version && yarn --version && \ + python --version && pip --version && pipenv --version && \ + poetry --version && uv --version" # Push image - name: Push image @@ -97,7 +103,10 @@ jobs: run: | mkdir builds/ digest="${{ steps.build-and-push.outputs.digest }}" - echo '${{ toJSON(matrix) }}' | jq --arg digest "$digest" '. +={"digest": $digest}' >> "builds/${{ matrix.key }}.json" + echo '${{ toJSON(matrix) }}' | + jq --arg digest "$digest" \ + '. +={"digest": $digest}' \ + >> "builds/${{ matrix.key }}.json" - name: Upload build context uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0