Skip to content

Commit

Permalink
Fix CI docker build/push action. (#70)
Browse files Browse the repository at this point in the history
* Fix CI docker build/push action.
  • Loading branch information
jgadling authored Jun 28, 2024
1 parent 5c9cd74 commit 4659a05
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,8 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Clean previous builds
run: rm -rf dist/*.whl

- name: Build with Poetry
run: poetry build
run: make build-wheel

- name: Build and push Docker image
uses: docker/build-push-action@v2
Expand Down
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ help: ## display help for this makefile
@echo "### SHARED FUNCTIONS END ###"

.PHONY: codegen
codegen: build-base ## Run codegen to convert the LinkML schema to a GQL API
codegen: build-docker-base ## Run codegen to convert the LinkML schema to a GQL API
$(docker_compose_run) $(BUILD_CONTAINER) api generate --schemafile ./schema/schema.yaml --output-prefix .
$(docker_compose_run) $(CONTAINER) black .
#$(docker_compose_run) $(CONTAINER) ruff check --fix .
Expand Down Expand Up @@ -66,18 +66,21 @@ gha-setup: ## Set up the environment in CI
docker swarm init
touch test_app/.moto_recording

.PHONY: build-base ## Build the base docker image
build-base:
.PHONY: build-wheel ## Create python packages and export requirements.
build-wheel:
rm -rf dist/*.whl
poetry build
# Export poetry dependency list as a requirements.txt, which makes Docker builds
# faster by not having to reinstall all dependencies every time we build a new wheel.
poetry export --without-hashes --format=requirements.txt > requirements.txt

.PHONY: build-docker-base ## Build the base docker image
build-docker-base: build-wheel
$(docker_compose) build
rm requirements.txt

.PHONY: build ## Build the base docker image and the test app docker image
build: build-base
build: build-docker-base
$(MAKE_TEST_APP) build

.PHONY: dev ## Launch a container suitable for developing the platformics library
Expand Down

0 comments on commit 4659a05

Please sign in to comment.