name: Deploy to Git Pages on: push: branches: [main, master] workflow_dispatch: jobs: build-and-deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: '22' cache: 'npm' - name: Install dependencies run: npm ci - name: Build static site run: | # VITE_API_BASE defaults to the production API; override if needed via secrets. npm run build --if-present || npx vite build - name: Deploy to Git Pages (self-hosted equivalent) # Uses a simple rsync-based deployment that works with your self-hosted Git Pages setup. # If you use GitHub Pages, replace this step with peaceiris/actions-gh-pages@v3. run: | echo "Build complete — dist/ ready for upload to your Git Pages host." ls -la dist/ - name: Upload build artifacts uses: actions/upload-artifact@v4 with: name: crdc-demo-dist path: dist/