Skip to content

Commit 33c4e2b

Browse files
committed
(wip)
1 parent c2c9a73 commit 33c4e2b

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

.github/workflows/docker-build.yaml

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ on:
3333
variations:
3434
type: string
3535
required: true
36+
push:
37+
type: boolean
38+
default: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
3639

3740
jobs:
3841
build:
@@ -55,6 +58,9 @@ jobs:
5558
https://github.com/webdevops/go-replace/releases/download/$GOREPLACE_VERSION/go-replace.linux.amd64
5659
chmod +x /usr/local/bin/go-replace
5760
61+
- name: test
62+
run: echo ${{ toJson(inputs) }}
63+
5864
- name: build Dockerfile
5965
env:
6066
DOCKER_BUILD_VERSION: ${{ inputs.version }}
@@ -84,18 +90,11 @@ jobs:
8490
tags: |
8591
type=raw,value=${{ inputs.name }},enable=true
8692
87-
- name: Should push?
88-
id: shouldPush
89-
run: |
90-
if [[ ${{ github.event.ref }} = "refs/heads/master" ]]; then
91-
echo "match=true" >> $GITHUB_OUTPUT
92-
fi
93-
9493
- name: Build and push Docker image
9594
uses: docker/build-push-action@v5
9695
with:
9796
context: .
98-
push: ${{ steps.shouldPush.outputs.match == 'true' }}
97+
push: ${{ inputs.push }}
9998
tags: ${{ steps.meta.outputs.tags }}
10099
labels: ${{ steps.meta.outputs.labels }}
101100

@@ -133,19 +132,12 @@ jobs:
133132
tags: |
134133
type=raw,value=${{ inputs.name }}-${{ matrix.variation }},enable=true
135134
136-
- name: Should push?
137-
id: shouldPush
138-
run: |
139-
if [[ ${{ github.event.ref }} = "refs/heads/master" ]]; then
140-
echo "match=true" >> $GITHUB_OUTPUT
141-
fi
142-
143135
- name: Build and push Docker image
144136
uses: docker/build-push-action@v5
145137
with:
146138
context: .
147139
build-args: IMAGE_BASE=lojassimonetti/php-apache-oci8-composer:${{ inputs.name }}
148140
file: ./Dockerfile.${{ matrix.variation }}
149-
push: ${{ steps.shouldPush.outputs.match == 'true' }}
141+
push: ${{ inputs.push }}
150142
tags: ${{ steps.meta.outputs.tags }}
151143
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)