-
Notifications
You must be signed in to change notification settings - Fork 32
60 lines (52 loc) · 1.77 KB
/
5_docs_deploy.yml
File metadata and controls
60 lines (52 loc) · 1.77 KB
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
name: Deploy docs to GitHub Pages
on:
push:
branches: [ main ]
workflow_dispatch:
jobs:
deploy:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ['3.7']
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
timeout-minutes: 10
steps:
- name: Check out code repository
uses: actions/checkout@v2
with:
path: github-actions-cicd-example
- name: Check out docs repository
uses: actions/checkout@v2
with:
repository: alexmalins/alexmalins.github.io
path: alexmalins.github.io
token: ${{secrets.PUSH_TOKEN}}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
cd github-actions-cicd-example
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements_docs.txt
- name: Build docs
run: |
cd github-actions-cicd-example/docs
make html
- name: Push docs
run: |
cp -RT github-actions-cicd-example/docs/build/html alexmalins.github.io/docs/github-actions-cicd-example
cd alexmalins.github.io
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add -A
git diff-index --quiet HEAD || (git commit -m "Documentation update" && git push https://$USERNAME:[email protected]/alexmalins/alexmalins.github.io.git)
env:
REPO_KEY: ${{secrets.PUSH_TOKEN}}
USERNAME: github-actions[bot]