Run-PDFReports-Notebook #325
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-PDFReports-Notebook | |
on: | |
schedule: | |
- cron: "0 0 * * WED" | |
jobs: | |
workflow: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- name: Import code from current GitHub repo | |
uses: actions/checkout@v2 | |
- name: Install non-Python dependencies | |
run: | | |
sudo apt update | |
sudo apt install nodejs | |
sudo apt install npm | |
sudo chown -R $USER /usr/local/lib/node_modules | |
sudo chown -R $USER /usr/local/bin/ | |
npm install -g electron@6.1.4 orca | |
- name: Setup Python 3 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Install Python dependencies | |
run: | | |
pip install -r requirements.txt | |
pip install papermill | |
- name: Run notebook | |
run: papermill report-pdf.ipynb report-pdf.ipynb | |
- name: Free disk space | |
run: | | |
sudo swapoff -a | |
sudo rm -f /swapfile | |
sudo apt clean | |
docker rmi $(docker image ls -aq) | |
df -h | |
- name: Commit files | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git add -A | |
git commit -m "GitHub Actions - Reports updates $(date)" -a | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} |