-
-
Notifications
You must be signed in to change notification settings - Fork 177
65 lines (53 loc) · 1.98 KB
/
pdf-at-pr.yaml
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
# This workflow will install Python dependencies and generate PDF file at PR
name: Create offline documentation on PR
on:
pull_request:
types: [opened, reopened, synchronize, labeled]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.8 ]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
path: documentation
- uses: actions/checkout@v4
with:
ref: www
path: www
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
cd documentation
python -m pip install --upgrade pip
pip install setuptools wheel
pip install -r requirements.txt
- name: Run mkdocs --clean
run: |
cd documentation
mkdocs build --clean
- name: Push to web
run: |
cd www
mkdir -p "${{ github.event.number }}"
rsync -av ../documentation/site/. ${{ github.event.number }}
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "Updating repo" || true
git push origin www || true
- uses: devindford/[email protected]
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
body-template: |
[![Create offline documentation on PR](https://github.com/armbian/documentation/actions/workflows/pdf-at-pr.yaml/badge.svg)](https://github.com/armbian/documentation/actions/workflows/pdf-at-pr.yaml)
Documentation website preview will be available in few minutes:
<a href=https://armbian.github.io/documentation/${{ github.event.number }}><kbd> <br> Open WWW preview <br> </kbd></a>
body-update-action: 'suffix'