Skip to content

Commit 3d39cce

Browse files
committed
Merge branch 'upstream-PR/00-workflow-test-nobs' into upstream-PR/all-PR-combined
2 parents feb1dd2 + e59a27e commit 3d39cce

1 file changed

Lines changed: 19 additions & 4 deletions

File tree

.github/workflows/build.yaml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,21 @@ on:
55
branches: [main]
66
schedule:
77
- cron: "0 00,12 * * *" # Twice a day
8+
workflow_dispatch:
9+
inputs:
10+
force:
11+
description: Force rebuild and republish all image tags
12+
required: false
13+
default: true
14+
type: boolean
15+
image_name:
16+
description: Override image name for this manual run
17+
required: false
18+
default: ""
19+
type: string
20+
21+
env:
22+
IMAGE_NAME: ${{ inputs.image_name || vars.IMAGE_NAME || 'nikolaik/python-nodejs' }}
823

924
jobs:
1025
generate-matrix:
@@ -23,7 +38,7 @@ jobs:
2338
- name: Generate build matrix
2439
id: set-matrix
2540
run: |
26-
FORCE=$(if git log --pretty=format:"%s" HEAD^..HEAD | grep -q '\[force\]'; then echo "--force"; else echo ""; fi)
41+
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)
2742
uv run dpn $FORCE build-matrix --event ${{ github.event_name }}
2843
2944
@@ -59,12 +74,12 @@ jobs:
5974
context: .
6075
file: dockerfiles/${{ matrix.key }}.Dockerfile
6176
load: true
62-
tags: nikolaik/python-nodejs:${{ matrix.key }}
77+
tags: ${{ env.IMAGE_NAME }}:${{ matrix.key }}
6378

6479
# Test
6580
- name: Run smoke tests
6681
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"
82+
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"
6883
6984
# Push image
7085
- name: Push image
@@ -75,7 +90,7 @@ jobs:
7590
file: dockerfiles/${{ matrix.key }}.Dockerfile
7691
platforms: ${{ join(matrix.platforms) }}
7792
push: true
78-
tags: nikolaik/python-nodejs:${{ matrix.key }}
93+
tags: ${{ env.IMAGE_NAME }}:${{ matrix.key }}
7994

8095
# Store build context
8196
- name: Add digest to build context

0 commit comments

Comments
 (0)