Generate statistics #47
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: Publish | |
on: | |
push: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v1 | |
with: | |
python-version: 3.9 | |
- name: Install dependencies | |
run: | | |
python -m pip install poetry | |
poetry install | |
- name: Check style | |
run: | | |
poetry run black . --check | |
- name: Check flake8 | |
run: | | |
poetry run flake8 | |
- name: Create generated directory | |
run: | | |
mkdir -p generated | |
- name: Generate stats | |
run: | | |
python3 stats.py >generated/stats.csv | |
- name: Generate | |
run: | | |
poetry run python festivus.py | |
- name: Publish | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "GitHub Actions" | |
cd generated | |
sudo chown -R $(id -un) . | |
mv ../.git . | |
git branch -M gh-pages | |
git add -f . | |
git commit -m 'Deploy' | |
git push --force origin HEAD | |
if: github.ref == 'refs/heads/master' && github.event_name == 'push' |