Skip to content

Commit

Permalink
feat: add build to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
EveningStarlight committed Nov 28, 2024
1 parent 532b817 commit 71b2e7d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .github/workflows/docker-build-test-upload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Download a parent image, build a new one, and test it; then upload the ima
env:
REGISTRY_NAME: k8scc01covidacr
DEV_REGISTRY_NAME: k8scc01covidacrdev
LOCAL_REPO: localhost:5000
HADOLINT_VERSION: "2.12.0"

on:
Expand Down Expand Up @@ -62,3 +63,11 @@ jobs:
login-server: ${{ env.DEV_REGISTRY_NAME }}.azurecr.io
username: ${{ secrets.DEV_REGISTRY_USERNAME }}
password: ${{ secrets.DEV_REGISTRY_PASSWORD }}

# make build emits full_image_name, image_tag, and image_repo outputs
- name: Build image
id: build-image
run: make build/${{ input.image }} REPO=${{ env.LOCAL_REPO }}

- name: Echo disk usage after build completion
run: ./.github/scripts/echo_usage.sh
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ build/%: ## build the latest image
# End repo with exactly one trailing slash, unless it is empty
REPO=$$(echo "$(REPO)" | sed 's:/*$$:/:' | sed 's:^\s*/*\s*$$::') &&\
IMAGE_NAME="$${REPO}$(notdir $@):$(TAG)" && \
DOCKER_BUILDKIT=0 docker build $(DARGS) --rm --force-rm -t $$IMAGE_NAME ./output/$(notdir $@) && \
docker build $(DARGS) --rm --force-rm -t $$IMAGE_NAME ./images/$(notdir $@) && \
echo -n "Built image $$IMAGE_NAME of size: " && \
docker images $$IMAGE_NAME --format "{{.Size}}" && \
echo "full_image_name=$$IMAGE_NAME" >> $(GITHUB_OUTPUT) && \
Expand Down

0 comments on commit 71b2e7d

Please sign in to comment.