-
Notifications
You must be signed in to change notification settings - Fork 11
62 lines (51 loc) · 2.05 KB
/
techdocs.yaml
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
name: Publish Product Central TechDocs
on:
push:
branches:
- main
paths:
- "architectures/docs/techdocs/**"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
publish-product-central-techdocs:
name: Publish Product Central TechDocs
runs-on: ubuntu-latest
env:
TECHDOCS_S3_BUCKET_NAME: ${{ secrets.AWS_BUCKET_NAME }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
ENTITY_NAMESPACE: "default"
ENTITY_TEMPLATE: "Template"
ENTITY_COMPONENT: "Component"
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v4
- name: Setup local Turbo cache
uses: dtinth/setup-github-actions-caching-for-turbo@v1
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Install techdocs-cli
run: sudo npm install -g @techdocs/cli
- name: Install mkdocs and mkdocs plugins
run: python -m pip install mkdocs-techdocs-core==1.*
- name: Generate and Publish docs site
run: |
for dir in architectures/docs/techdocs/*/ ; do
ENTITY_NAME=$(basename "$dir")
echo "Generating docs for $ENTITY_NAME"
cd "$dir"
techdocs-cli generate --no-docker --output-dir "site" --verbose
cd - # Return to the previous directory
echo "Publishing docs for $ENTITY_NAME to $ENTITY_TEMPLATE and $ENTITY_COMPONENT buckets"
techdocs-cli publish --publisher-type awsS3 --storage-name $TECHDOCS_S3_BUCKET_NAME --entity $ENTITY_NAMESPACE/$ENTITY_TEMPLATE/$ENTITY_NAME --directory "$dir/site"
techdocs-cli publish --publisher-type awsS3 --storage-name $TECHDOCS_S3_BUCKET_NAME --entity $ENTITY_NAMESPACE/$ENTITY_COMPONENT/$ENTITY_NAME --directory "$dir/site"
done