Skip to content

Commit 33c7fd8

Browse files
committed
Add steps to save and upload Docker image as an artifact
This update saves the Docker image to a tar file and uploads it as an artifact using GitHub Actions. These changes enable better portability and allow the image to be reused in other workflows or environments.
1 parent 30148b5 commit 33c7fd8

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

.github/workflows/deploy-minikube.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,20 @@ jobs:
1919
docker build -f ./pipeline/Dockerfile -t devopshint/node-app:latest .
2020
echo -n "verifying images:"
2121
docker images
22+
23+
- name: Save Docker image
24+
run: |
25+
export SHELL=/bin/bash
26+
eval $(minikube -p minikube docker-env)
27+
docker save devopshint/node-app:latest -o node-app.tar
28+
echo "Docker image saved to node-app.tar"
29+
30+
- name: Upload Docker image artifact
31+
uses: actions/upload-artifact@v4 # Use the latest version
32+
with:
33+
name: node-app-docker-image
34+
path: node-app.tar
35+
2236
- name: Deploy to minikube
2337
run:
2438
kubectl apply -f ./pipeline/k8s-node-app.yaml

0 commit comments

Comments
 (0)