Skip to content

Commit f91164b

Browse files
authored
Merge pull request #6863 from Ocelot-Social-Community/documentation-deployment
feat(other): add documentation deployment
2 parents 5359f4a + e6213fe commit f91164b

File tree

3 files changed

+103
-17
lines changed

3 files changed

+103
-17
lines changed

.github/file-filters.yml

+16-1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,20 @@ webapp: &webapp
1212
- 'webapp/**/*'
1313
- 'package.json'
1414

15-
markdown-files: &markdown-files
15+
docs-check: &docs-check
16+
- '.github/workflows/check-documentation.yml'
17+
18+
markdown: &markdown
19+
- *docs-check
1620
- '**/*.md'
21+
- '.github/workflows/mlc_config.json'
22+
23+
vuepress: &vuepress
24+
- *docs-check
25+
- '.github/workflows/deploy-documentation.yml'
26+
- '.vuepress/**/*'
27+
- 'package.json'
28+
29+
documentation: &documentation
30+
- *vuepress
31+
- *markdown

.github/workflows/check-documentation.yml

+39-16
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ jobs:
77
name: Detect File Changes - Markdown files
88
runs-on: ubuntu-latest
99
outputs:
10-
markdown-files: ${{ steps.changes.outputs.markdown-files }}
10+
markdown: ${{ steps.changes.outputs.markdown }}
11+
documentation: ${{ steps.changes.outputs.documentation }}
1112
steps:
1213
- name: Checkout code
1314
uses: actions/checkout@master
@@ -22,21 +23,43 @@ jobs:
2223

2324
check-markdown-links:
2425
name: Check Markdown links
25-
if: needs.files-changed.outputs.markdown-files == 'true'
2626
needs: files-changed
2727
runs-on: ubuntu-latest
28+
if: needs.files-changed.outputs.markdown == 'true'
2829
steps:
29-
- name: Checkout code
30-
uses: actions/checkout@master
31-
- name: Remove old documentation files
32-
run: rm -rf ./deployment/src/old/ ./CHANGELOG.md # workaround until https://github.com/gaurav-nelson/github-action-markdown-link-check/pull/183 has been done
33-
- name: Check Markdown Links
34-
uses: gaurav-nelson/github-action-markdown-link-check@master
35-
with:
36-
use-quiet-mode: 'yes'
37-
use-verbose-mode: 'no'
38-
# at any .md file change take the chance to check the links in all .md files
39-
check-modified-files-only: 'no'
40-
config-file: '.github/workflows/mlc_config.json'
41-
base-branch: 'master'
42-
folder-path: '.'
30+
- name: Checkout code
31+
uses: actions/checkout@master
32+
33+
- name: Remove old documentation files
34+
run: rm -rf ./deployment/src/old/ ./CHANGELOG.md # workaround until https://github.com/gaurav-nelson/github-action-markdown-link-check/pull/183 has been done
35+
36+
- name: Check Markdown Links
37+
uses: gaurav-nelson/github-action-markdown-link-check@master
38+
with:
39+
use-quiet-mode: 'yes'
40+
use-verbose-mode: 'no'
41+
# at any .md file change take the chance to check the links in all .md files
42+
check-modified-files-only: 'no'
43+
config-file: '.github/workflows/mlc_config.json'
44+
base-branch: 'master'
45+
folder-path: '.'
46+
47+
test-vuepress-build:
48+
name: Test Vuepress build
49+
needs: files-changed
50+
runs-on: ubuntu-latest
51+
if: needs.files-changed.outputs.documentation == 'true'
52+
steps:
53+
- name: Checkout code
54+
uses: actions/checkout@master
55+
56+
- name: Setup Node 20
57+
uses: actions/setup-node@v4
58+
with:
59+
node-version: '20'
60+
61+
- name: npm-install
62+
run: npm install
63+
64+
- name: npm-docs:build
65+
run: npm run docs:build
+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: ocelot.social deploy documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
files-changed:
10+
name: Detect File Changes - Markdown and Vuepress files
11+
runs-on: ubuntu-latest
12+
outputs:
13+
documentation: ${{ steps.changes.outputs.documentation }}
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@master
17+
18+
- name: Check for file changes
19+
uses: dorny/paths-filter@master
20+
id: changes
21+
with:
22+
token: ${{ github.token }}
23+
filters: .github/file-filters.yml
24+
list-files: shell
25+
26+
build-and-deploy:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@master
31+
32+
- name: Setup Node 20
33+
uses: actions/setup-node@v4
34+
with:
35+
node-version: 20
36+
37+
- name: Build Vuepress Pages
38+
run: npm install && npm run build
39+
40+
- name: Deploy Vuepress to Github Pages
41+
uses: crazy-max/ghaction-github-pages@v4
42+
with:
43+
target_branch: gh-pages
44+
build_dir: .vuepress/dist
45+
author: Wolfgang Huß <[email protected]>
46+
fqdn: docs.ocelot.social
47+
env:
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)