Fix build workflow: split Save image artifact into two steps
- Separate docker save command from upload-artifact action - Fix invalid syntax error (cannot use both uses: and run: in same step) - Steps now properly separated: Save image to file, then Upload image artifact
This commit is contained in:
@@ -109,13 +109,16 @@ jobs:
|
|||||||
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login ${{ env.REGISTRY }} -u "${{ secrets.REGISTRY_USERNAME }}" --password-stdin
|
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login ${{ env.REGISTRY }} -u "${{ secrets.REGISTRY_USERNAME }}" --password-stdin
|
||||||
docker push "${{ steps.image.outputs.full }}"
|
docker push "${{ steps.image.outputs.full }}"
|
||||||
|
|
||||||
- name: Save image artifact
|
- name: Save image to file
|
||||||
|
if: env.REGISTRY == ''
|
||||||
|
run: |
|
||||||
|
docker save "${IMAGE_NAME}:${IMAGE_TAG}" -o /tmp/image.tar
|
||||||
|
|
||||||
|
- name: Upload image artifact
|
||||||
|
if: env.REGISTRY == ''
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: docker-image
|
name: docker-image
|
||||||
path: /tmp/image.tar
|
path: /tmp/image.tar
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
if: env.REGISTRY == ''
|
|
||||||
run: |
|
|
||||||
docker save "${IMAGE_NAME}:${IMAGE_TAG}" -o /tmp/image.tar
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user