|
33 | 33 | variations: |
34 | 34 | type: string |
35 | 35 | required: true |
| 36 | + push: |
| 37 | + type: boolean |
| 38 | + default: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }} |
36 | 39 |
|
37 | 40 | jobs: |
38 | 41 | build: |
|
55 | 58 | https://github.com/webdevops/go-replace/releases/download/$GOREPLACE_VERSION/go-replace.linux.amd64 |
56 | 59 | chmod +x /usr/local/bin/go-replace |
57 | 60 |
|
| 61 | + - name: test |
| 62 | + run: echo ${{ toJson(inputs) }} |
| 63 | + |
58 | 64 | - name: build Dockerfile |
59 | 65 | env: |
60 | 66 | DOCKER_BUILD_VERSION: ${{ inputs.version }} |
@@ -84,18 +90,11 @@ jobs: |
84 | 90 | tags: | |
85 | 91 | type=raw,value=${{ inputs.name }},enable=true |
86 | 92 |
|
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 | | -
|
94 | 93 | - name: Build and push Docker image |
95 | 94 | uses: docker/build-push-action@v5 |
96 | 95 | with: |
97 | 96 | context: . |
98 | | - push: ${{ steps.shouldPush.outputs.match == 'true' }} |
| 97 | + push: ${{ inputs.push }} |
99 | 98 | tags: ${{ steps.meta.outputs.tags }} |
100 | 99 | labels: ${{ steps.meta.outputs.labels }} |
101 | 100 |
|
@@ -133,19 +132,12 @@ jobs: |
133 | 132 | tags: | |
134 | 133 | type=raw,value=${{ inputs.name }}-${{ matrix.variation }},enable=true |
135 | 134 |
|
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 | | -
|
143 | 135 | - name: Build and push Docker image |
144 | 136 | uses: docker/build-push-action@v5 |
145 | 137 | with: |
146 | 138 | context: . |
147 | 139 | build-args: IMAGE_BASE=lojassimonetti/php-apache-oci8-composer:${{ inputs.name }} |
148 | 140 | file: ./Dockerfile.${{ matrix.variation }} |
149 | | - push: ${{ steps.shouldPush.outputs.match == 'true' }} |
| 141 | + push: ${{ inputs.push }} |
150 | 142 | tags: ${{ steps.meta.outputs.tags }} |
151 | 143 | labels: ${{ steps.meta.outputs.labels }} |
0 commit comments