deploy.yml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. name: Hourly Data Refresh & Deploy
  2. # 1. When should this action run?
  3. on:
  4. schedule:
  5. - cron: "0 * * * *" # Runs at minute 0 of every hour
  6. workflow_dispatch: # Allows you to click a "Run" button manually in GitHub
  7. push:
  8. branches:
  9. - main # Also runs automatically when you push new code to the 'main' branch
  10. # 2. Grant permissions so the action can publish to GitHub Pages
  11. permissions:
  12. contents: read
  13. pages: write
  14. id-token: write
  15. # 3. Ensure we don't run multiple deployments at the exact same time
  16. concurrency:
  17. group: "pages"
  18. cancel-in-progress: false
  19. # 4. The actual sequence of commands
  20. jobs:
  21. build-and-deploy:
  22. environment:
  23. name: github-pages
  24. url: ${{ steps.deployment.outputs.page_url }}
  25. runs-on: ubuntu-latest
  26. steps:
  27. - name: Checkout Repository
  28. uses: actions/checkout@v4
  29. # Setup our tools
  30. - name: Install uv
  31. uses: astral-sh/setup-uv@v5
  32. - name: Set up Python
  33. uses: actions/setup-python@v5
  34. with:
  35. python-version: '3.13' # Based on your pyproject.toml
  36. - name: Setup Bun
  37. uses: oven-sh/setup-bun@v1
  38. with:
  39. bun-version: latest
  40. # Run the exact sequence from your dev.sh script
  41. - name: Generate Backend Data (Python)
  42. run: uv run roi.py
  43. - name: Install Frontend Dependencies (Bun)
  44. run: bun install
  45. - name: Build Frontend (Bun)
  46. run: bun run build
  47. # Package the 'www' folder and send it to GitHub Pages
  48. - name: Setup GitHub Pages
  49. uses: actions/configure-pages@v5
  50. - name: Upload artifact
  51. uses: actions/upload-pages-artifact@v3
  52. with:
  53. path: './www'
  54. - name: Deploy to GitHub Pages
  55. id: deployment
  56. uses: actions/deploy-pages@v4