| name: Deploy to GitHub Pages | |
| on: | |
| push: | |
| branches: | |
| - 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: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install git+https://github.com/SAP-samples/sap-rpt-1-oss | |
| - name: Generate synthetic data | |
| run: | | |
| python -c "from utils.data_generator import generate_all_datasets; generate_all_datasets()" | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v3 | |
| - name: Build documentation | |
| run: | | |
| # Create a simple HTML page for GitHub Pages | |
| mkdir -p _site | |
| cat > _site/index.html << 'EOF' | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>SAP Finance Dashboard with RPT-1-OSS</title> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <style> | |
| body { | |
| font-family: Arial, sans-serif; | |
| max-width: 800px; | |
| margin: 50px auto; | |
| padding: 20px; | |
| line-height: 1.6; | |
| } | |
| h1 { color: #2c3e50; } | |
| .info-box { | |
| background: #f8f9fa; | |
| padding: 20px; | |
| border-radius: 8px; | |
| margin: 20px 0; | |
| } | |
| code { | |
| background: #e9ecef; | |
| padding: 2px 6px; | |
| border-radius: 3px; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <h1>SAP Finance Dashboard with RPT-1-OSS</h1> | |
| <div class="info-box"> | |
| <h2>About</h2> | |
| <p>This is a Python-based financial dashboard application built with Mesop that integrates the SAP-RPT-1-OSS model for predictive analysis.</p> | |
| </div> | |
| <div class="info-box"> | |
| <h2>Running Locally</h2> | |
| <p>To run this application locally:</p> | |
| <ol> | |
| <li>Clone the repository</li> | |
| <li>Install dependencies: <code>pip install -r requirements.txt</code></li> | |
| <li>Install SAP-RPT-OSS: <code>pip install git+https://github.com/SAP-samples/sap-rpt-1-oss</code></li> | |
| <li>Set up environment variables (see README.md)</li> | |
| <li>Run: <code>mesop app.py</code></li> | |
| </ol> | |
| </div> | |
| <div class="info-box"> | |
| <h2>Deployment</h2> | |
| <p>Since Mesop requires a Python backend, this application cannot run directly on GitHub Pages. Consider deploying to:</p> | |
| <ul> | |
| <li>Streamlit Cloud</li> | |
| <li>Heroku</li> | |
| <li>Railway</li> | |
| <li>Render</li> | |
| <li>Or use GitHub Actions to run as a service</li> | |
| </ul> | |
| </div> | |
| <div class="info-box"> | |
| <h2>Documentation</h2> | |
| <p>See <code>README.md</code> for full documentation and setup instructions.</p> | |
| </div> | |
| </body> | |
| </html> | |
| EOF | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v2 | |
| with: | |
| path: '_site' | |
| 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@v2 | |