33 lines
727 B
Makefile
33 lines
727 B
Makefile
APP_NAME := forgejo-tickets
|
|
REGISTRY := registry.ts.mattnite.net
|
|
IMAGE := $(REGISTRY)/$(APP_NAME)
|
|
GIT_SHA := $(shell git rev-parse HEAD)
|
|
|
|
.PHONY: build run test tailwind tailwind-watch docker docker-push clean
|
|
|
|
build: tailwind
|
|
go build -o $(APP_NAME) ./cmd/server
|
|
|
|
run:
|
|
go run ./cmd/server
|
|
|
|
test:
|
|
go test ./...
|
|
|
|
tailwind:
|
|
npx @tailwindcss/cli -i web/static/css/input.css -o web/static/css/output.css --minify
|
|
|
|
tailwind-watch:
|
|
npx @tailwindcss/cli -i web/static/css/input.css -o web/static/css/output.css --watch
|
|
|
|
docker:
|
|
docker build -t $(IMAGE):$(GIT_SHA) -t $(IMAGE):latest .
|
|
|
|
docker-push: docker
|
|
docker push $(IMAGE):$(GIT_SHA)
|
|
docker push $(IMAGE):latest
|
|
|
|
clean:
|
|
rm -f $(APP_NAME)
|
|
rm -f web/static/css/output.css
|