Add binaries cross compile in CD (#113)

This commit is contained in:
Thomas Miceli
2023-09-26 15:13:58 +02:00
committed by GitHub
parent fa8e068e24
commit 30ca090e74
9 changed files with 134 additions and 7 deletions

View File

@ -1,10 +1,12 @@
.PHONY: all install build_frontend build_backend build build_docker watch_frontend watch_backend watch clean clean_docker check_changes go_mod fmt test
.PHONY: all all_crosscompile install build_frontend build_backend build build_crosscompile build_docker watch_frontend watch_backend watch clean clean_docker check_changes go_mod fmt test
# Specify the name of your Go binary output
BINARY_NAME := opengist
all: clean install build
all_crosscompile: clean install build_frontend build_crosscompile
install:
@echo "Installing NPM dependencies..."
@npm ci || (echo "Error: Failed to install NPM dependencies." && exit 1)
@ -21,6 +23,9 @@ build_backend:
build: build_frontend build_backend
build_crosscompile:
@bash ./scripts/build-all.sh
build_docker:
@echo "Building Docker image..."
docker build -t $(BINARY_NAME):latest .
@ -34,12 +39,12 @@ watch_backend:
OG_DEV=1 npx nodemon --watch '**/*' -e html,yml,go,js --signal SIGTERM --exec 'go run . --config config.yml'
watch:
@bash ./watch.sh
@bash ./scripts/watch.sh
clean:
@echo "Cleaning up build artifacts..."
@rm -f $(BINARY_NAME) public/manifest.json
@rm -rf public/assets
@rm -rf public/assets build
clean_docker:
@echo "Cleaning up Docker image..."