fix: run templ generate in Dockerfile before build
Some checks failed
CI / Deploy / test (push) Successful in 14s
CI / Deploy / lint (push) Successful in 25s
CI / Deploy / deploy (push) Failing after 34s

The _templ.go files are gitignored, so the Docker build context doesn't
include them. Generate them before compiling.
This commit is contained in:
Ryan Hamamura
2026-03-02 22:53:00 -10:00
parent d77e4af1e2
commit 8780b7c9b1

View File

@@ -7,6 +7,7 @@ COPY go.mod go.sum ./
RUN go mod download RUN go mod download
COPY . . COPY . .
RUN go tool templ generate
RUN go tool gotailwind -i assets/css/input.css -o assets/css/output.css --minify RUN go tool gotailwind -i assets/css/input.css -o assets/css/output.css --minify
RUN --mount=type=cache,target=/root/.cache/go-build \ RUN --mount=type=cache,target=/root/.cache/go-build \
CGO_ENABLED=0 go build -ldflags="-s" -o /bin/games . CGO_ENABLED=0 go build -ldflags="-s" -o /bin/games .