Build static website #117
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: Build static website | |
on: | |
push: | |
branches: | |
- "main" | |
schedule: | |
- cron: "0 15 * * 5" | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Create branch directories | |
run: mkdir -p main public | |
- uses: actions/checkout@v2 | |
with: | |
path: main | |
- uses: actions/checkout@v2 | |
with: | |
ref: public | |
path: public | |
- name: Install Python3 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.9' | |
- name: Install dependencies | |
run: python3 -m pip install -r requirements.txt | |
working-directory: ./main | |
- name: Generate index.html | |
run: python3 ./csv2html.py | |
working-directory: ./main | |
- name: Copy files to right location | |
run: | | |
cp main/index.html public | |
cp -r "main/siteAssets" public | |
- name: Commit back updated files to public branch | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
repository: public | |
commit_message: Updating page |