File tree Expand file tree Collapse file tree 3 files changed +23
-7
lines changed
Expand file tree Collapse file tree 3 files changed +23
-7
lines changed Original file line number Diff line number Diff line change 3434 username : ${{ github.actor }}
3535 password : ${{ secrets.GITHUB_TOKEN }}
3636
37- - name : Test
38- run : make test
39-
4037 - name : Make tag
4138 run : |
4239 [ "${GITHUB_EVENT_NAME}" == 'pull_request' ] && echo "tag=${GITHUB_HEAD_REF##*/}" >> $GITHUB_ENV || true
4643 - name : Set up Docker Buildx
4744 uses : docker/setup-buildx-action@v3
4845
46+ - name : Build and export minimal image to Docker
47+ uses : docker/build-push-action@v6
48+ with :
49+ context : .
50+ load : true
51+ tags : ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ env.tag }}-minimal
52+ target : minimal
53+
54+ - name : Test
55+ run : |
56+ make test
57+ env :
58+ VERSION : ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ env.tag }}-minimal
59+
4960 - name : Build and push minimal image
5061 uses : docker/build-push-action@v6
5162 with :
Original file line number Diff line number Diff line change 1- FROM metal-deployment-base
1+ ARG VERSION=metal-deployment-base
2+ FROM ${VERSION}
23COPY test .
Original file line number Diff line number Diff line change 1+ VERSION := $(or $(VERSION ) ,metal-deployment-base)
12ifeq ($(CI ) ,true)
23 DOCKER_RUN_ARG =
34else
45 DOCKER_RUN_ARG =t
56endif
67
8+ .PHONY : build
9+ build :
10+ docker build -t $(VERSION ) .
11+
712.PHONY : test
813test :
9- docker build -t metal-deployment-base .
10- docker build -t metal-deployment-base-test -f Dockerfile.test .
11- docker run --rm -i$(DOCKER_RUN_ARG ) metal-deployment-base-test bash -c \
14+ docker build -t $(VERSION ) -test -f Dockerfile.test --build-arg=$(VERSION ) .
15+ docker run --rm -i$(DOCKER_RUN_ARG ) $(VERSION ) -test bash -c \
1216 ' ansible -m metalstack.base.metal_stack_release_vector localhost && find ~/.ansible/roles -maxdepth 1 -type d -ls'
You can’t perform that action at this time.
0 commit comments