Skip to content

Commit

Permalink
Split building binaries and images into separate workflow steps
Browse files Browse the repository at this point in the history
Splitting into separate workflow steps makes the workflow more transparant

Signed-off-by: Marco Franssen <marco.franssen@gmail.com>
  • Loading branch information
marcofranssen committed Jun 30, 2023
1 parent 6e16bb6 commit 9851276
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@ jobs:
version: v1.53
args: --timeout 7m

- name: Run make all
run: make all
- name: Build binaries
run: make build-binaries

- name: Build images
run: make images

- name: Print job result
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/master-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
# build and push images tagged with GITHUB_SHA, version, and latest
- name: Build and push tornjak backend image
run: make release-backend

- name: Build and push tornjak frontend image
run: make release-frontend

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ binaries: $(addprefix bin/,$(BINARIES)) ## Build bin/tornjak-backend and bin/tor
bin/tornjak-backend: tornjak-backend/cmd/agent $(GO_FILES) | vendor ## Build tornjak-backend binary
# Build hack because of flake of imported go module
docker run --rm -v "${PWD}":/usr/src/myapp -w /usr/src/myapp -e GOOS=linux -e GOARCH=amd64 golang:$(GO_VERSION) \
/bin/sh -c "go build --tags 'sqlite_json' ./$<; go build --tags 'sqlite_json' -mod=vendor -ldflags '-s -w -linkmode external -extldflags "-static"' -o $@ ./$<"
/bin/sh -c "go build --tags 'sqlite_json' ./$</main.go; go build --tags 'sqlite_json' -mod=vendor -ldflags '-s -w -linkmode external -extldflags "-static"' -o $@ ./$</main.go"

bin/tornjak-manager: tornjak-backend/cmd/manager $(GO_FILES) | vendor ## Build bin/tornjak-manager binary
# Build hack because of flake of imported go module
docker run --rm -v "${PWD}":/usr/src/myapp -w /usr/src/myapp -e GOOS=linux -e GOARCH=amd64 golang:$(GO_VERSION) \
/bin/sh -c "go build --tags 'sqlite_json' -o tornjak-manager ./$<; go build --tags 'sqlite_json' -mod=vendor -ldflags '-s -w -linkmode external -extldflags "-static"' -o $@ ./$<"
/bin/sh -c "go build --tags 'sqlite_json' -o tornjak-manager ./$</main.go; go build --tags 'sqlite_json' -mod=vendor -ldflags '-s -w -linkmode external -extldflags "-static"' -o $@ ./$</main.go"

frontend-local-build: ## Build tornjak-frontend
npm install --prefix tornjak-frontend
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 9851276

Please sign in to comment.