Files
HowBadIsMyBatch/.github/workflows/buildAndDeployWebsite.yml
2024-04-26 18:21:49 +02:00

61 lines
2.5 KiB
YAML

name: build-and-deploy-website
run-name: build and deploy website
on:
workflow_dispatch:
schedule:
# At 01:30 on Saturday:
- cron: '30 1 * * 6'
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checking out repository code
uses: actions/checkout@v3
with:
token: ${{ secrets.HOW_BAD_IS_MY_BATCH_ACCESS_TOKEN }}
- name: Configuring git
run: |
git config --global user.email "<>"
git config --global user.name "no name"
- name: Installing dependencies
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: howbadismybatch-venv
environment-file: environment.yml
- name: Installing Google Chrome
shell: bash -el {0}
run: |
conda activate howbadismybatch-venv
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb
sudo apt install google-chrome-stable
pip install --upgrade selenium webdriver-manager
- name: Installing ipython kernel
shell: bash -el {0}
run: |
conda activate howbadismybatch-venv
ipython kernel install --user --name=howbadismybatch-venv-kernel
- name: Executing HowBadIsMyBatch.ipynb
shell: bash -el {0}
run: |
conda activate howbadismybatch-venv
cd src
jupyter nbconvert --to script HowBadIsMyBatch.ipynb
python ./HowBadIsMyBatch.py
# jupyter nbconvert --ExecutePreprocessor.kernel_name="howbadismybatch-venv-kernel" --to notebook --allow-errors --execute HowBadIsMyBatch.ipynb
# jupyter nbconvert --to html HowBadIsMyBatch.nbconvert.ipynb
git add -A
git diff-index --quiet HEAD || git commit -m "updating data for batch codes"
- name: Executing Intensivstationen.ipynb
shell: bash -el {0}
run: |
cd src/intensivstationen
DATAWRAPPER_API_TOKEN=${{ secrets.DATAWRAPPER_API_TOKEN }} jupyter nbconvert --ExecutePreprocessor.kernel_name="howbadismybatch-venv-kernel" --to notebook --allow-errors --execute Intensivstationen.ipynb
jupyter nbconvert --to html Intensivstationen.nbconvert.ipynb
git add -A
git diff-index --quiet HEAD || git commit -m "updating data for Intensivstationen"
- name: Pushing changes to GitHub Pages
shell: bash -el {0}
run: |
git push