diff --git a/.github/workflows/deploy-frontend.yml b/.github/workflows/deploy-frontend.yml new file mode 100644 index 0000000..3d3eabb --- /dev/null +++ b/.github/workflows/deploy-frontend.yml @@ -0,0 +1,45 @@ +name: Build & Publish Frontend to GitHub Pages + +on: + push: + branches: [ "main" ] + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Use Node.js 18 + uses: actions/setup-node@v4 + with: + node-version: "18" + + - name: Install & build frontend + working-directory: frontend + env: + VITE_API_BASE: ${{ secrets.FRONTEND_API_BASE }} + VITE_SOCKET_URL: ${{ secrets.FRONTEND_SOCKET_URL }} + run: | + npm ci + # ensure build-time env vars exist for Vite (safe defaults if secrets missing) + cat > .env.production <