Automatic
wireless performance tests
#446
This file contains hidden or 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
name: Create docs preview on PR | |
on: | |
pull_request: | |
types: [opened, reopened, synchronize, labeled] | |
workflow_dispatch: | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
docs-preview: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout PR branch (documentation) | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
path: documentation | |
- name: Checkout `www` branch | |
uses: actions/checkout@v4 | |
with: | |
ref: www | |
path: www | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.8 | |
- name: Cache pip dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('documentation/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install dependencies | |
working-directory: documentation | |
run: | | |
python -m pip install --upgrade pip | |
pip install setuptools wheel | |
pip install -r requirements.txt | |
- name: Build docs with MkDocs | |
working-directory: documentation | |
run: mkdocs build --clean | |
- name: Publish to `www` branch | |
working-directory: www | |
run: | | |
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 "Update docs preview for PR #${{ github.event.number }}" || true | |
git push origin www || true | |
- name: Comment on PR with preview link | |
uses: devindford/[email protected] | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
body-template: | | |
[](https://github.com/armbian/documentation/actions/workflows/pdf-at-pr.yaml) | |
Documentation website preview will be available shortly: | |
<a href="https://armbian.github.io/documentation/${{ github.event.number }}"><kbd><br> Open WWW preview <br></kbd></a> | |
body-update-action: suffix |