forked from lyz-code/blue-book
-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (61 loc) · 1.78 KB
/
gh-pages.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
---
name: github pages
concurrency:
group: build-gh-pages
cancel-in-progress: true
on:
push:
branches:
- master
schedule:
- cron: 10 05 * * *
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
# Number of commits to fetch. 0 indicates all history.
# Default: 1
fetch-depth: 0
- name: Setup Python
# https://github.com/actions/virtual-environments/issues/1202
# uses: actions/setup-python@v1
# with:
# python-version: '3.7'
uses: actions/setup-python@v2
with:
python-version: 3.x
architecture: x64
- name: Cache dependencies
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: pip install pip-tools
- name: Update requirements
run: make update
- name: Make the site
run: make build-docs
- name: Commit files
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add requirements.txt
git add docs/newsletter
git diff-index --quiet HEAD \
|| git commit -m "chore: update dependency and publish newsletters"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: master
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_dir: ./site