How to make a workflow file to save the output as a file to my GitHub Repo? #26672
-
For past 3 days I have been learning about matplotlib and pandas from youtube and I tried to implement my knowledge by making a very basic python project,which analyzes data from an api hosted by the Govt of India containing the data of COVID-19 cases in different states of India. My project is almost complete and is working fine in my local machine and I have hosted it to github pages as well. The problem is that I wrote a python script to convert jupyter notebook to static index.html in the root folder and it works fine on my local machine.Basically my jupyter notebook takes data from the API source and analyzes it to display useful information,but GitHub pages cannot host jupyter notebooks so the script converts notebook to index.html file and saves it directly to root directory (Idea is to make index.html serve as the home page for GitHub pages) but when I made a workflow file to serve the purpose and when it executed something unexpected happened. Below is My Workflow file run.yml located in .github/workflows/run.yml
NOTE: I have Used dir commands to see where the index.html file is getting stored. Output of first dir command Output of second dir commandSeems like my script (update.py) is working fine but instead of saving index.html to the root directory of my Github Repo it is saving it somewhere else. I need help to make changes in my code to make index.html file to be saved on my GitHub repo as it will serve as the home page for my Github Pages. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi @piyushke , Based on my understanding of your requirement, you want to push the index.html which created/changed during the workflow execution to your GitHub Repo. You could add some steps to commit changes and push back to current repo. There is my example workflow yml:
If I misunderstood your scenario, please feel free to point me out. |
Beta Was this translation helpful? Give feedback.
-
Dear yanjingzhu, thank you for your reply. While studying your answer, I ended up with 2 questions:
|
Beta Was this translation helpful? Give feedback.
Hi @piyushke ,
Based on my understanding of your requirement, you want to push the index.html which created/changed during the workflow execution to your GitHub Repo.
You could add some steps to commit changes and push back to current repo. There is my example workflow yml: