Skip to content

Commit 7ca4944

Browse files
committed
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.
1 parent feb1dd2 commit 7ca4944

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

.github/workflows/build.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
schedule:
77
- cron: "0 00,12 * * *" # Twice a day
88

9+
env:
10+
IMAGE_NAME: ${{ vars.IMAGE_NAME || 'nikolaik/python-nodejs' }}
11+
912
jobs:
1013
generate-matrix:
1114
name: Generate build matrix
@@ -59,12 +62,12 @@ jobs:
5962
context: .
6063
file: dockerfiles/${{ matrix.key }}.Dockerfile
6164
load: true
62-
tags: nikolaik/python-nodejs:${{ matrix.key }}
65+
tags: ${{ env.IMAGE_NAME }}:${{ matrix.key }}
6366

6467
# Test
6568
- name: Run smoke tests
6669
run: |
67-
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"
70+
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"
6871
6972
# Push image
7073
- name: Push image
@@ -75,7 +78,7 @@ jobs:
7578
file: dockerfiles/${{ matrix.key }}.Dockerfile
7679
platforms: ${{ join(matrix.platforms) }}
7780
push: true
78-
tags: nikolaik/python-nodejs:${{ matrix.key }}
81+
tags: ${{ env.IMAGE_NAME }}:${{ matrix.key }}
7982

8083
# Store build context
8184
- name: Add digest to build context

0 commit comments

Comments
 (0)