budgit/Taskfile.yml
juancwu 6e00b7387e
All checks were successful
Deploy / build-and-deploy (push) Successful in 1m0s
devops: deployment setup and docs
2026-02-09 20:53:25 +00:00

39 lines
1.4 KiB
YAML

version: "3"
vars:
TEMPL_PROXYBIND: '{{.TEMPL_PROXYBIND | default "127.0.0.1"}}'
TEMPL_PROXYPORT: '{{.TEMPL_PROXYPORT | default "7331"}}'
TEMPL_PROXY: '{{.TEMPL_PROXY | default "http://127.0.0.1:9000"}}'
tasks:
# Development Tools
templ:
desc: Run templ with integrated server and hot reload
cmds:
- go tool templ generate --watch --cmd="go run ./cmd/server/main.go" --proxybind="{{.TEMPL_PROXYBIND}}" --proxyport="{{.TEMPL_PROXYPORT}}" --proxy="{{.TEMPL_PROXY}}" --open-browser=false
tailwind-clean:
desc: Clean tailwind output
cmds:
- tailwindcss -i ./assets/css/input.css -o ./assets/css/output.css --clean
tailwind-watch:
desc: Run tailwindcss in watch mode
cmds:
- tailwindcss -i ./assets/css/input.css -o ./assets/css/output.css --watch
# Start development server
dev:
desc: Start development server with hot reload
deps:
- tailwind-clean
cmds:
- echo "Starting app..."
- task --parallel tailwind-watch templ
# Production build
build:
desc: Build production binary
vars:
VERSION:
sh: git describe --tags --always
cmds:
- tailwindcss -i ./assets/css/input.css -o ./assets/css/output.css --minify
- go tool templ generate
- mkdir -p ./dist
- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w -X main.version={{.VERSION}}" -o ./dist/budgit ./cmd/server/main.go