Skip to content

Commit 0f0401d

Browse files
authored
fix: syntax
1 parent 17f0007 commit 0f0401d

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

.github/workflows/buildx.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,22 @@ jobs:
7575
with:
7676
install: true
7777

78+
- name: Set build path
79+
id: buildpath
80+
run: |
81+
if [ "${{ matrix.variant }}" = "default" ]; then
82+
echo "path=./${{ matrix.ruby-version }}/${{ matrix.node-version }}" >> $GITHUB_OUTPUT
83+
else
84+
echo "path=./${{ matrix.ruby-version }}/${{ matrix.node-version }}/${{ matrix.variant }}" >> $GITHUB_OUTPUT
85+
fi
86+
7887
- name: Docker Buildx (build)
7988
uses: docker/[email protected]
80-
env:
81-
BUILD_PATH: ./${{ matrix.ruby-version }}/${{ matrix.node-version }}${{ matrix.variant == 'default' && '' || '/${{ matrix.variant }}' }}
8289
if: success() && !contains(github.ref, 'master')
8390
with:
8491
push: false
85-
context: ${{ env.BUILD_PATH }}
86-
file: ./${{ matrix.ruby-version }}/${{ matrix.node-version }}${{ matrix.variant != 'default' && '/${{ matrix.variant }}' || '' }}/Dockerfile
92+
context: ${{ steps.buildpath.outputs.path }}
93+
file: ${{ steps.buildpath.outputs.path }}/Dockerfile
8794
build-args: REFRESHED_AT=$(date +%Y-%m-%d)
8895
platforms: ${{ matrix.platforms }}
8996
tags: ${{ steps.prepare.outputs.tags }}
@@ -97,13 +104,11 @@ jobs:
97104

98105
- name: Docker Buildx (push)
99106
uses: docker/[email protected]
100-
env:
101-
BUILD_PATH: ./${{ matrix.ruby-version }}/${{ matrix.node-version }}${{ matrix.variant == 'default' && '' || '/${{ matrix.variant }}' }}
102107
if: success() && github.event_name != 'pull_request' && contains(github.ref, 'master')
103108
with:
104109
push: true
105-
context: ${{ env.BUILD_PATH }}
106-
file: ./${{ matrix.ruby-version }}/${{ matrix.node-version }}${{ matrix.variant != 'default' && '/${{ matrix.variant }}' || '' }}/Dockerfile
110+
context: ${{ steps.buildpath.outputs.path }}
111+
file: ${{ steps.buildpath.outputs.path }}/Dockerfile
107112
build-args: REFRESHED_AT=$(date +%Y-%m-%d)
108113
platforms: ${{ matrix.platforms }}
109114
tags: ${{ steps.prepare.outputs.tags }}

0 commit comments

Comments
 (0)