-
-
Notifications
You must be signed in to change notification settings - Fork 18
34 lines (32 loc) · 971 Bytes
/
publishAndBuild.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
name: build and publish gh pages
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v5
with:
python-version: 3.8
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: build mkdocs and deploy to gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
ln -sf ${GITHUB_WORKSPACE}/README.md ${GITHUB_WORKSPACE}/docs/index.md
git remote add gh-pages https://x-access-token:${GITHUB_TOKEN}@github.com/coolya/mps.rocks.git
git fetch gh-pages
mkdocs gh-deploy --clean -r gh-pages