-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (40 loc) · 1.17 KB
/
main.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
name: ci
on:
push
# Environment
env:
CI: true
PYTHON_VERSION: 3.x
# Jobs to run
jobs:
# Build and deploy documentation site
deploy:
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
# Checkout source form GitHub
- uses: actions/checkout@v2
with:
fetch-depth: 0
# Install Python runtime and dependencies
- uses: actions/setup-python@v1
with:
python-version: ${{ env.PYTHON_VERSION }}
# pip
- run: |
pip install -r requirements.txt
pip install mkdocs-minify-plugin>=0.2
# Set configuration for repository and deploy documentation
- env:
GH_TOKEN: ${{ secrets.mkdocs }}
GH_NAME: ci
GH_EMAIL: [email protected]
run: |
REMOTE="https://${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}"
git config --global user.name "${GH_NAME}"
git config --global user.email "${GH_EMAIL}"
git remote set-url origin ${REMOTE}
# deploy
- run: |
mkdocs gh-deploy --force
mkdocs --version