Skip to content

Commit

Permalink
publish as latest
Browse files Browse the repository at this point in the history
  • Loading branch information
naoki9911 committed Nov 9, 2023
1 parent a7ce0d1 commit 23975dc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/publish-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
publish-image:
runs-on: ubuntu-latest
env:
STAGINGVERSION: latest
STAGINGVERSION: ${{ github.ref_name }}
DOCKER_BUILD_ARGS: --push
steps:
- uses: actions/checkout@v4
Expand Down
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ DOCKER_BUILD_ARGS += --provenance=false
endif

LOAD_TO_KIND ?= false
PUSH_LATEST ?= false

$(info STAGINGVERSION is ${STAGINGVERSION})
$(info DRIVER_IMAGE is ${DRIVER_IMAGE})
Expand Down Expand Up @@ -62,6 +63,10 @@ build-driver:
--file ./cmd/csi_driver/Dockerfile \
--tag ${IMAGE_NAME} \
--platform linux/amd64 .
if [ "${PUSH_LATEST}" = "true" ]; then\
docker tag ${IMAGE_NAME} ${DRIVER_IMAGE}:latest
docker push ${DRIVER_IMAGE}:latest
fi
if [ "${LOAD_TO_KIND}" = "true" ]; then \
kind load docker-image ${IMAGE_NAME};\
fi
Expand All @@ -80,6 +85,11 @@ build-example-$(1)-$(2):
--file ./examples/$1/$2/Dockerfile \
--tag ${IMAGE_NAME} \
--platform linux/amd64 .
if [ "${PUSH_LATEST}" = "true" ]; then\
$(eval IMAGE_NAME_LATEST := ${EXAMPLE_IMAGE}-$1-$2:latest)
docker tag ${IMAGE_NAME} ${IMAGE_NAME_LATEST}
docker push ${IMAGE_NAME_LATEST}
fi
if [ "${LOAD_TO_KIND}" = "true" ]; then \
kind load docker-image ${IMAGE_NAME};\
fi
Expand Down

0 comments on commit 23975dc

Please sign in to comment.