Lets generate webpage preview at PR #22
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 github-actions@github.com | |
git add . | |
git commit -m "Updating repo" | |
git push origin www | |
- uses: devindford/Append_PR_Comment@v1.1.2 | |
with: | |
repo-token: "${{ secrets.GITHUB_TOKEN }}" | |
body-template: | | |
Documentation website preview is available in PR stage: | |
<br> | |
<a href=https://armbian.github.io/documentation/${{ github.event.number }}><kbd> <br> Open WWW preview <br> </kbd></a> | |
body-update-action: 'suffix' |