feat: Builds docker image during tests in ci
This commit is contained in:
@@ -3,7 +3,7 @@ name: Create and publish a Docker image
|
|||||||
# Configures this workflow to run every time a change is pushed to the branch called `release`.
|
# Configures this workflow to run every time a change is pushed to the branch called `release`.
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: ['main']
|
# branches: ['main']
|
||||||
tags:
|
tags:
|
||||||
- '*.*.*'
|
- '*.*.*'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|||||||
11
justfile
11
justfile
@@ -1,8 +1,8 @@
|
|||||||
docker_image := "purchase_orders"
|
docker_image := "purchase_orders"
|
||||||
docker_tag := "latest"
|
docker_tag := "latest"
|
||||||
|
|
||||||
build-docker:
|
build-docker file="Dockerfile":
|
||||||
@docker build -t {{docker_image}}:{{docker_tag}} .
|
@docker build -f {{file}} -t {{docker_image}}:{{docker_tag}} .
|
||||||
|
|
||||||
seed:
|
seed:
|
||||||
swift run App seed
|
swift run App seed
|
||||||
@@ -19,8 +19,5 @@ clean:
|
|||||||
bootstrap:
|
bootstrap:
|
||||||
cp ./env.example .env
|
cp ./env.example .env
|
||||||
|
|
||||||
test-docker:
|
test-docker: (build-docker "dev.Dockerfile")
|
||||||
@docker run --rm \
|
@docker run --rm {{docker_image}}:{{docker_tag}} swift test
|
||||||
-v "${PWD}:/app" \
|
|
||||||
-w "/app" "swift:6.0-noble" \
|
|
||||||
swift test
|
|
||||||
|
|||||||
Reference in New Issue
Block a user