Fix some minor issues #22
Workflow file for this run
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 and Deploy | |
on: | |
push: | |
branches: | |
- 'main' | |
pull_request: | |
# Allow manual runs through the web UI | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
check_style: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Install dependencies | |
run: | | |
python -m pip install tox | |
- name: Check Style | |
run: | | |
tox -e codestyle | |
run_script: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Install dependencies | |
run: | | |
sudo apt install pandoc | |
python -m pip install tox | |
- name: Run Script | |
run: | | |
tox -e py311 | |
- name: Run notebook and create html index | |
run: | | |
tox -e notebook | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: files | |
path: | | |
timeline* | |
index.html | |
deploy: | |
needs: [run_script] | |
# if: | | |
# ( | |
# github.event_name != 'pull_request' && ( | |
# github.ref_name != 'main' || | |
# github.event_name == 'workflow_dispatch' | |
# ) | |
# ) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get current date | |
id: date | |
run: echo "::set-output name=date::$(date +'%Y%m%d')" | |
- name: Download all workflow run artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: files | |
path: ~/files | |
- name: Display structure of downloaded files | |
run: ls -R | |
working-directory: /home/runner/ | |
- name: Upload files then create tag and release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
tag: ${{ steps.date.outputs.date }} | |
file: | | |
/home/runner/files/timeline_${{ steps.date.outputs.date }}.txt | |
/home/runner/files/timeline_${{ steps.date.outputs.date }}.csv | |
overwrite: true | |
body: "Latest version of the timeline" | |
- name: Push index.html to branch page | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: /home/runner/files |