Light theme Color and virtualization #18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Builds the React app (with generated report.db), deploys to GitHub Pages. | |
| # Separate from weekly-report.yml, which runs on a schedule and commits report artifacts to the repo. | |
| name: Deploy to GitHub Pages | |
| on: | |
| push: | |
| branches: [master, main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install Python dependencies | |
| run: | | |
| pip install -r requirements.txt | |
| pip install -r requirements-ml.txt | |
| - name: Download spaCy English model | |
| run: python -m spacy download en_core_web_sm | |
| - name: Generate report and SQLite DB | |
| run: python -m src | |
| - name: Ensure report.db in UI/public | |
| run: | | |
| if [ ! -f report.db ]; then | |
| echo "::error::report.db not found after python -m src" | |
| exit 1 | |
| fi | |
| cp report.db UI/public/report.db | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - name: Install dependencies | |
| run: npm install | |
| working-directory: UI | |
| - name: Build static site | |
| run: npm run build | |
| working-directory: UI | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v4 | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| name: github-pages-${{ github.run_id }} | |
| path: UI/dist | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 | |
| with: | |
| artifact_name: github-pages-${{ github.run_id }} |