-
Notifications
You must be signed in to change notification settings - Fork 7
50 lines (46 loc) · 1.47 KB
/
main.yaml
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
44
45
46
47
48
49
50
name: Auto-build HTML files
on:
push:
branches:
- working
schedule:
- cron: '0 8 * * *' # Runs at 8:00 AM UTC every day
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
steps:
- name: Load repository
uses: actions/checkout@v2
- name: Switch to the master branch (or create it if it doesn't exist)
run: |
git checkout -B master
- name: Reset master to point to working's HEAD
run: |
git fetch --all --no-tags
git reset --hard origin/working
git status
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r src/scripts/requirements.txt
python src/scripts/make_requirements_hooks_file.py
pip install -r src/scripts/requirements_hooks.txt
- name: Run python build script
run: |
python src/scripts/build_site.py --delete-scheduled-posts
- name: Commit files
run: |
git config --local user.name "Github Action"
git config --local user.email "[email protected]"
git add --all
git diff-index --quiet HEAD || git commit -m "Auto-build"
- name: Push changes
run: |
git push -f --set-upstream origin master