-
Notifications
You must be signed in to change notification settings - Fork 11
43 lines (43 loc) · 1.08 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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'