-
Notifications
You must be signed in to change notification settings - Fork 1
111 lines (93 loc) · 2.9 KB
/
update_std_docs.yml
File metadata and controls
111 lines (93 loc) · 2.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: Update ArkDoc documentation
on:
schedule:
- cron: "0 0 1 * *"
workflow_dispatch:
repository_dispatch:
types:
- my_update_docs
permissions:
contents: write
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "update-docs"
cancel-in-progress: false
defaults:
run:
shell: bash
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout website
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Checkout ArkDoc
uses: actions/checkout@v6
with:
repository: ArkScript-lang/ArkDoc
path: './arkdoc'
ref: 'master'
- name: Checkout std
uses: actions/checkout@v6
with:
repository: ArkScript-lang/std
path: './std-latest'
- name: Checkout ArkScript
uses: actions/checkout@v6
with:
repository: ArkScript-lang/Ark
path: './ark-latest'
ref: 'dev'
# so that we can fetch tags
fetch-depth: 0
- name: Checkout modules
uses: actions/checkout@v6
with:
repository: ArkScript-lang/modules
path: './ark-modules'
- uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Pip install
run: |
cd arkdoc/
pip install -r requirements.txt
- name: Generate documentation
shell: bash
run: |
ark_version=$(cd ark-latest; git describe --tags | cut -f1 -d-)
echo "New ArkScript tag: ${ark_version}"
# run arkdoc
cd arkdoc
export ARKDOC_LOGLEVEL=DEBUG
python -m arkdoc $ark_version \
../ark-latest/docs/arkdoc/ \
../ark-latest/src/arkreactor/Builtins/ \
../std-latest/ \
--markdown out || exit 1
cd ..
cp arkdoc/out/$ark_version/* ./content/docs/std/
- name: Update modules docs
shell: bash
run: |
for f in ark-modules/{draft,src}/*/documentation/*.md; do
module_name=$(basename $(dirname $(dirname $f)))
if [[ "$(basename f)" == "README.md" ]]; then
mv $f "content/docs/std/module_${module_name}.md"
fi
done
- name: Commit
uses: github-actions-x/commit@v2.9
with:
github-token: ${{ secrets.WEBSITE_PUSH_COMMIT_GITHUB_TOKEN }}
push-branch: 'master'
commit-message: 'chore: update stdlib documentation'
force-add: 'true'
files: ./content/docs/std/
name: Lex Plt through GitHub Action
email: lexplt.dev@gmail.com