Skip to content

Commit b478e5a

Browse files
committed
ci: use env vars in save docker artifacts step
1 parent 2d00ae5 commit b478e5a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

.github/actions/build-docker/action.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,19 +156,23 @@ runs:
156156
- name: Save Docker image as artifact
157157
if: inputs.publish-image == 'false' && inputs.arch == 'amd64'
158158
shell: bash
159+
env:
160+
SERVICE: ${{ inputs.service }}
161+
ARCH: ${{ inputs.arch }}
162+
TYPE: ${{ inputs.type }}
159163
run: |
160164
set -o xtrace
161165
162166
# Get image name from docker-compose-ci.yml
163-
IMAGE=$(docker compose -f docker-compose-ci.yml config --format json 2>/dev/null | jq -r --arg s "${{ inputs.service }}" '.services[$s].image')
167+
IMAGE=$(docker compose -f docker-compose-ci.yml config --format json 2>/dev/null | jq -r --arg s "$SERVICE" '.services[$s].image')
164168
165169
# Create directory for image archives
166170
mkdir -p /tmp/docker-images
167171
168172
# Save the image to a tar file
169-
docker save "${IMAGE}" -o "/tmp/docker-images/${{ inputs.service }}-${{ inputs.arch }}-${{ inputs.type }}.tar"
173+
docker save "${IMAGE}" -o "/tmp/docker-images/${SERVICE}-${ARCH}-${TYPE}.tar"
170174
171-
echo "Saved image to /tmp/docker-images/${{ inputs.service }}-${{ inputs.arch }}-${{ inputs.type }}.tar"
175+
echo "Saved image to /tmp/docker-images/${SERVICE}-${ARCH}-${TYPE}.tar"
172176
ls -lh /tmp/docker-images/
173177
174178
- name: Upload Docker image artifact

0 commit comments

Comments
 (0)