mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-02-18 00:17:39 +01:00
fix(workflow): build frontend before building backend in demo deployment
This commit is contained in:
34
.github/workflows/deploy-demo-server.yml
vendored
34
.github/workflows/deploy-demo-server.yml
vendored
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user