Skip to content

Commit b9a7ab8

Browse files
committed
include mkdocs in project, add gh workflow
1 parent b49fdf0 commit b9a7ab8

File tree

3 files changed

+56
-49
lines changed

3 files changed

+56
-49
lines changed

.github/workflows/build-faq.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Build FAQ site
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
paths:
8+
- 'docs/**'
9+
- 'assets/**'
10+
- 'mkdocs_remote.yml'
11+
pull_request:
12+
branches:
13+
- dev
14+
paths:
15+
- 'docs/**'
16+
- 'assets/**'
17+
- 'mkdocs_remote.yml'
18+
workflow_dispatch:
19+
20+
permissions:
21+
contents: write
22+
23+
jobs:
24+
build:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 0
31+
- name: Set up Python
32+
uses: actions/setup-python@v5
33+
with:
34+
python-version: '3.x'
35+
- name: Install MkDocs
36+
run: pip install mkdocs
37+
- name: Build docs into faq
38+
run: mkdocs build --config-file mkdocs_remote.yml --site-dir faq
39+
- name: Commit built FAQ
40+
id: commit
41+
run: |
42+
if git status --porcelain faq | grep -q .; then
43+
git config user.name "github-actions[bot]"
44+
git config user.email "github-actions[bot]@users.noreply.github.com"
45+
git add faq
46+
git commit -m "chore: build FAQ site [skip ci]"
47+
echo "created=true" >> "$GITHUB_OUTPUT"
48+
else
49+
echo "created=false" >> "$GITHUB_OUTPUT"
50+
fi
51+
- name: Push changes to dev
52+
if: steps.commit.outputs.created == 'true'
53+
env:
54+
TARGET_BRANCH: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || 'dev' }}
55+
run: git push origin "$TARGET_BRANCH"

faq/index.php

Lines changed: 0 additions & 48 deletions
This file was deleted.

scripts/pack-build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function createArchive(fileName, archive) {
6565
archive.directory('tools');
6666
archive.directory('vendor');
6767
archive.file('config/.htaccess');
68-
archive.file('faq/index.php');
68+
archive.directory('faq');
6969
archive.file('HEAD');
7070
archive.file('composer.json');
7171
archive.file('index.php');

0 commit comments

Comments
 (0)