ci: pass docker push input as a string, not a boolean
Gitea's act_runner mangles boolean workflow_call/dispatch inputs passed
from an expression -- they arrive as false regardless of value. Declare
`push` as a string ("true"/"false") and compare with == 'true' so the
builder image is pushed on non-PR events again.
This commit is contained in:
parent
903dd4eea5
commit
66feb91821
@ -63,7 +63,8 @@ jobs:
|
|||||||
if: ${{ needs.changes.outputs.dockerfile == 'true' }}
|
if: ${{ needs.changes.outputs.dockerfile == 'true' }}
|
||||||
uses: ./.gitea/workflows/docker.yaml
|
uses: ./.gitea/workflows/docker.yaml
|
||||||
with:
|
with:
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
# Explicit string, not a boolean expression (act_runner mangles bools).
|
||||||
|
push: ${{ github.event_name == 'pull_request' && 'false' || 'true' }}
|
||||||
|
|
||||||
# Runs after docker (if docker ran). A skipped docker job is fine; a failed
|
# Runs after docker (if docker ran). A skipped docker job is fine; a failed
|
||||||
# one blocks this via !failure(). Re-run tests when code OR the image changed.
|
# one blocks this via !failure(). Re-run tests when code OR the image changed.
|
||||||
|
|||||||
@ -4,19 +4,22 @@ name: '🐳 Builder Image'
|
|||||||
# It is called by ci.yaml only when Dockerfile.builder or docs/requirements.txt
|
# It is called by ci.yaml only when Dockerfile.builder or docs/requirements.txt
|
||||||
# change. It runs on the host runner (NOT inside the builder container) because
|
# change. It runs on the host runner (NOT inside the builder container) because
|
||||||
# it needs the Docker CLI/daemon.
|
# it needs the Docker CLI/daemon.
|
||||||
|
# Note: `push` is a STRING ("true"/"false"), not a boolean. Gitea's act_runner
|
||||||
|
# mangles boolean inputs passed from an expression (they arrive as false), so we
|
||||||
|
# pass an explicit string and compare with == 'true' below.
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
push:
|
push:
|
||||||
description: 'Push the built image to the registry'
|
description: 'Push the built image to the registry ("true"/"false")'
|
||||||
type: boolean
|
type: string
|
||||||
default: true
|
default: 'true'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
push:
|
push:
|
||||||
description: 'Push the built image to the registry'
|
description: 'Push the built image to the registry ("true"/"false")'
|
||||||
type: boolean
|
type: string
|
||||||
default: true
|
default: 'true'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@ -48,7 +51,7 @@ jobs:
|
|||||||
.
|
.
|
||||||
|
|
||||||
- name: Push builder image
|
- name: Push builder image
|
||||||
if: ${{ inputs.push }}
|
if: ${{ inputs.push == 'true' }}
|
||||||
run: |
|
run: |
|
||||||
docker push gitea.tourolle.paris/dtourolle/kpnpp-builder:latest
|
docker push gitea.tourolle.paris/dtourolle/kpnpp-builder:latest
|
||||||
docker push gitea.tourolle.paris/dtourolle/kpnpp-builder:${{ github.sha }}
|
docker push gitea.tourolle.paris/dtourolle/kpnpp-builder:${{ github.sha }}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# KPN++ Builder Image (CI: pipeline trigger)
|
# KPN++ Builder Image (CI: pipeline trigger v2)
|
||||||
# Pre-built image with GCC, CMake, Ninja, and Python dev headers for building and testing KPN++
|
# Pre-built image with GCC, CMake, Ninja, and Python dev headers for building and testing KPN++
|
||||||
# Build: docker build -f Dockerfile.builder -t gitea.tourolle.paris/dtourolle/kpnpp-builder:latest .
|
# Build: docker build -f Dockerfile.builder -t gitea.tourolle.paris/dtourolle/kpnpp-builder:latest .
|
||||||
# Push: docker push gitea.tourolle.paris/dtourolle/kpnpp-builder:latest
|
# Push: docker push gitea.tourolle.paris/dtourolle/kpnpp-builder:latest
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user