-
Notifications
You must be signed in to change notification settings - Fork 78
53 lines (41 loc) · 1.24 KB
/
build-page-cache.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
name: Deploy cache
on:
push:
branches:
- master
jobs:
build-cache:
runs-on: ubuntu-latest
steps:
- name: Checkout master branch
uses: actions/checkout@v2
with:
ref: master
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install requirements of disposable submodule
run: |
git submodule init
git submodule update
pip3 install -r disposable/requirements.txt
- name: Run Python script
run: |
python generate-cache.py
- name: Commit files to gh-pages branch
run: |
git config --global user.name 'GitHub Actions'
git config --global user.email '[email protected]'
# Switch to gh-pages branch
git checkout -b gh-pages
# Add all generated files (if your script generates files to be committed)
git add cache/ --force
# Copy README_pages.md to README.md
cp README_pages.md README.md
# overwrite default readme.md
git add README.md
# Commit the changes
git commit -m "Update cache [skip ci]" && git push origin gh-pages --force
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}