Run Notebook and Save Results #8
This file contains 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
name: Run Notebook and Save Results | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: # Enables manual trigger from GitHub Actions UI | |
jobs: | |
run-notebook: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pandas scikit-learn notebook pyarrow | |
- name: Run notebook | |
run: | | |
python -m pip install nbconvert | |
jupyter nbconvert --to notebook --execute tdIdf.ipynb --output processed_notebook.ipynb | |
- name: Archive results | |
run: | | |
mkdir -p results | |
mv processed_file.csv results/ | |
echo "Results saved to 'results/' directory" | |
- name: Upload results | |
uses: actions/upload-artifact@v3 | |
with: | |
name: processed-results | |
path: results/ |