Skip to content

Commit 4382387

Browse files
committed
Add template workflow to check for problems with MkDocs-based website
On every push or pull request that affects the source and configuration for the repository's MkDocs-based static website, build the site and fail if any problems were encountered.
1 parent 662a4cc commit 4382387

File tree

4 files changed

+161
-0
lines changed

4 files changed

+161
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# See: https://taskfile.dev/#/usage
2+
version: "3"
3+
4+
tasks:
5+
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-mkdocs-task/Taskfile.yml
6+
website:check:
7+
desc: Check whether the MkDocs-based website will build
8+
deps:
9+
- task: poetry:install-deps
10+
cmds:
11+
- poetry run mkdocs build --strict
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# "Check Website" workflow (MkDocs, Task)
2+
3+
Workflow file: [check-mkdocs-task.yml](check-mkdocs-task.yml)
4+
5+
Check for problems with a [MkDocs](https://www.mkdocs.org/)-based static website.
6+
7+
This is the version of the workflow for projects using the [Task](https://taskfile.dev/#/) task runner tool.
8+
9+
## Installation
10+
11+
See [the "Deploy Website" (MkDocs, Poetry) workflow documentation](deploy-mkdocs-poetry.md#installation)
12+
13+
## Assets
14+
15+
- [`Taskfile.yml`](assets/check-yaml-task/Taskfile.yml] - Build task.
16+
- Install to: repository root (or add the `website:build` task into the existing `Taskfile.yml`)
17+
- [`Taskfile.yml`](assets/shared/Taskfile.yml] - Installation task.
18+
- Add the `poetry:install-deps` task into the existing `Taskfile.yml`
19+
- Website assets - See [the "Deploy Website" (MkDocs, Poetry) workflow documentation](deploy-mkdocs-poetry.md#assets).
20+
21+
## Readme badge
22+
23+
Markdown badge:
24+
25+
```markdown
26+
[![Check Website status](https://github.com/REPO_OWNER/REPO_NAME/actions/workflows/check-mkdocs-task.yml/badge.svg)](https://github.com/REPO_OWNER/REPO_NAME/actions/workflows/check-mkdocs-task.yml)
27+
```
28+
29+
Replace the `REPO_OWNER` and `REPO_NAME` placeholders in the URLs with the final repository owner and name ([example](https://raw.githubusercontent.com/arduino-libraries/ArduinoIoTCloud/master/README.md)).
30+
31+
---
32+
33+
Asciidoc badge:
34+
35+
```adoc
36+
image:https://github.com/{repository-owner}/{repository-name}/actions/workflows/check-mkdocs-task.yml/badge.svg["Check Website status", link="https://github.com/{repository-owner}/{repository-name}/actions/workflows/check-mkdocs-task.yml"]
37+
```
38+
39+
Define the `{repository-owner}` and `{repository-name}` attributes and use them throughout the readme ([example](https://raw.githubusercontent.com/arduino-libraries/WiFiNINA/master/README.adoc)).
40+
41+
## Commit message
42+
43+
```
44+
Add CI workflow to check for problems with MkDocs-based website
45+
46+
On every push or pull request that affects the source and configuration for the repository's MkDocs-based static
47+
website, build the site and fail if any problems were encountered.
48+
```
49+
50+
## PR message
51+
52+
```markdown
53+
On every push or pull request that affects the source and configuration for the repository's [MkDocs](https://www.mkdocs.org/)-based static website, build the site and fail if any problems were encountered.
54+
```
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-mkdocs-task.md
2+
name: Check Website
3+
4+
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
5+
on:
6+
push:
7+
paths:
8+
- ".github/workflows/check-mkdocs-task.ya?ml"
9+
- "Taskfile.ya?ml"
10+
- "mkdocs.ya?ml"
11+
- "poetry.lock"
12+
- "pyproject.toml"
13+
- "docs/**"
14+
pull_request:
15+
paths:
16+
- ".github/workflows/check-mkdocs-task.ya?ml"
17+
- "Taskfile.ya?ml"
18+
- "mkdocs.ya?ml"
19+
- "poetry.lock"
20+
- "pyproject.toml"
21+
- "docs/**"
22+
workflow_dispatch:
23+
repository_dispatch:
24+
25+
jobs:
26+
check:
27+
runs-on: ubuntu-latest
28+
29+
steps:
30+
- name: Checkout repository
31+
uses: actions/checkout@v2
32+
33+
- name: Install Python
34+
uses: actions/setup-python@v2
35+
with:
36+
python-version: "3.9"
37+
38+
- name: Install Poetry
39+
run: pip install poetry
40+
41+
- name: Install Task
42+
uses: arduino/setup-task@v1
43+
with:
44+
repo-token: ${{ secrets.GITHUB_TOKEN }}
45+
version: 3.x
46+
47+
- name: Build website
48+
run: task website:check
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-mkdocs-task.md
2+
name: Check Website
3+
4+
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
5+
on:
6+
push:
7+
paths:
8+
- ".github/workflows/check-mkdocs-task.ya?ml"
9+
- "Taskfile.ya?ml"
10+
- "mkdocs.ya?ml"
11+
- "poetry.lock"
12+
- "pyproject.toml"
13+
- "docs/**"
14+
pull_request:
15+
paths:
16+
- ".github/workflows/check-mkdocs-task.ya?ml"
17+
- "Taskfile.ya?ml"
18+
- "mkdocs.ya?ml"
19+
- "poetry.lock"
20+
- "pyproject.toml"
21+
- "docs/**"
22+
workflow_dispatch:
23+
repository_dispatch:
24+
25+
jobs:
26+
check:
27+
runs-on: ubuntu-latest
28+
29+
steps:
30+
- name: Checkout repository
31+
uses: actions/checkout@v2
32+
33+
- name: Install Python
34+
uses: actions/setup-python@v2
35+
with:
36+
python-version: "3.9"
37+
38+
- name: Install Poetry
39+
run: pip install poetry
40+
41+
- name: Install Task
42+
uses: arduino/setup-task@v1
43+
with:
44+
repo-token: ${{ secrets.GITHUB_TOKEN }}
45+
version: 3.x
46+
47+
- name: Build website
48+
run: task website:check

0 commit comments

Comments
 (0)