From 26cb8e17e81d8fa4cfb52e293cf2423ba1d439fe Mon Sep 17 00:00:00 2001 From: "Gustavo \"Guz\" L. de Mello" Date: Thu, 23 May 2024 13:55:42 -0300 Subject: [PATCH] fix(ci): temp fix --- .github/workflows/deploy.yml | 16 ++++++++-------- makefile | 7 ++++++- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 59887c4..fcbf3cd 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -11,15 +11,15 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 - - uses: DeterminateSystems/nix-installer-action@main - - uses: DeterminateSystems/magic-nix-cache-action@main - - uses: DeterminateSystems/flake-checker-action@main - - name: Setup go - uses: actions/setup-go@v5 - - name: Generate templ files + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@main + - name: Setup Nix Cache + uses: DeterminateSystems/magic-nix-cache-action@main + - name: Check flake + uses: DeterminateSystems/flake-checker-action@main + - name: Build project run: | - nix run github:a-h/templ -- generate - ls pages + nix shell nixpkgs#go github:a-h/templ --command 'make build-vercel' - name: Deploy uses: amondnet/vercel-action@v25 with: diff --git a/makefile b/makefile index ea2a6f1..3089c8a 100644 --- a/makefile +++ b/makefile @@ -37,7 +37,12 @@ bin/www: main.go templ bin/vercel: cmd/vercel/main.go templ go build -o ./bin/vercel ./cmd/vercel/main.go -templ: +# For some reason "templ generate" does not detect the files in CI, so this is a +# workaround. +TEMPL_FILES=$(patsubst %.templ, %_templ.go, $(wildcard **/*.templ)) +templ: $(TEMPL_FILES) + @echo Generating templ files +%_templ.go: %.templ templ generate clean: