From 6031e20a19bd86762122906f46919d8068c2940d Mon Sep 17 00:00:00 2001 From: Yuktha Priya Date: Tue, 3 Feb 2026 02:08:32 -0500 Subject: [PATCH 1/4] ci: add GitHub Actions workflow to publish frontend to Pages --- .github/workflows/deploy-frontend.yml | 40 +++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/deploy-frontend.yml diff --git a/.github/workflows/deploy-frontend.yml b/.github/workflows/deploy-frontend.yml new file mode 100644 index 0000000..c01e38d --- /dev/null +++ b/.github/workflows/deploy-frontend.yml @@ -0,0 +1,40 @@ +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 + npm run build + + - name: Upload build artifact for GitHub Pages + uses: actions/upload-pages-artifact@v1 + with: + path: frontend/dist + + - name: Deploy to GitHub Pages + uses: actions/deploy-pages@v1 From 3ce0bd9ef3ff76460d3275ebfb8a0065f6cad8c0 Mon Sep 17 00:00:00 2001 From: yukthapriya Date: Tue, 3 Feb 2026 02:16:36 -0500 Subject: [PATCH 2/4] ci: ensure VITE_* envs at build time for Pages workflow --- .github/workflows/deploy-frontend.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/deploy-frontend.yml b/.github/workflows/deploy-frontend.yml index c01e38d..3d3eabb 100644 --- a/.github/workflows/deploy-frontend.yml +++ b/.github/workflows/deploy-frontend.yml @@ -29,6 +29,11 @@ jobs: 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 < Date: Tue, 3 Feb 2026 02:16:45 -0500 Subject: [PATCH 3/4] ci: trigger Pages rebuild From a1377ed019b6c5cb39cd42794ebe9f7c0c6cc06b Mon Sep 17 00:00:00 2001 From: yukthapriya Date: Tue, 3 Feb 2026 02:23:58 -0500 Subject: [PATCH 4/4] chore: ignore local env and build artifacts --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f310eca --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +# local env and build artifacts +.env.production +frontend/dist/ +frontend/node_modules/