Skip to content

React Based Project with Sqlite #12

React Based Project with Sqlite

React Based Project with Sqlite #12

Workflow file for this run

# Runs on schedule (and push to master): generates report, builds UI, commits index.html/report.db/assets to repo.
# Separate from deploy-pages.yml, which deploys the React app to GitHub Pages.
name: Monthly site report
on:
schedule:
- cron: '0 0 1 * *'
push:
branches: [master]
jobs:
generate-report:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: master
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Setup Node (for Lighthouse via npx)
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install Python dependencies
run: pip install -r requirements.txt
- name: Generate report
run: python -m src
- name: Build React UI
run: |
cd UI && npm ci && npm run build
- name: Copy report.db and build to root for deployment
run: |
cp report.db UI/dist/
cp -r UI/dist/index.html UI/dist/assets . 2>/dev/null || true
cp report.db .
- name: Commit and push report to repo
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add -f index.html report.db assets
git diff --staged --quiet || git commit -m "cron: monthly site report"
git push
- name: Upload report artifacts
uses: actions/upload-artifact@v4
with:
name: site-report-${{ github.run_number }}
path: |
index.html
report.db
assets
site_graph.svg
if-no-files-found: ignore