fix(workflow): build frontend before building backend in demo deployment

This commit is contained in:
rcourtman
2026-01-10 00:41:00 +00:00
parent 486ee29bc8
commit 9a59c4459b

View File

@@ -14,8 +14,38 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
go-version: '1.24'
cache: true
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: 'frontend-modern/package-lock.json'
- name: Install frontend dependencies
run: npm --prefix frontend-modern ci
- name: Restore frontend build cache
uses: actions/cache@v4
with:
path: frontend-modern/dist
key: frontend-build-${{ hashFiles('frontend-modern/package-lock.json', 'frontend-modern/src/**/*', 'frontend-modern/index.html', 'frontend-modern/postcss.config.cjs', 'frontend-modern/tailwind.config.cjs') }}
- name: Build frontend
run: |
if [ -d "frontend-modern/dist" ] && [ -f "frontend-modern/dist/index.html" ]; then
echo "Using cached frontend build";
else
npm --prefix frontend-modern run build;
fi
# Prepare embedding directory
rm -rf internal/api/frontend-modern
mkdir -p internal/api/frontend-modern
cp -r frontend-modern/dist internal/api/frontend-modern/
- name: Build static binary
run: CGO_ENABLED=0 go build -ldflags="-s -w" -o pulse cmd/pulse/main.go