-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
101 lines (91 loc) · 3.17 KB
/
action.yml
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
name: 'Backstage TechDocs'
description: 'Generate and publish Backstage TechDocs.'
author: 'Staffbase GmbH'
inputs:
entity-namespace:
description: 'Entity Namespace'
required: true
default: 'default'
entity-kind:
description: 'Entity Kind'
required: true
default: 'Component'
entity-name:
description: 'Entity Name'
required: true
publisher-type:
description: 'awsS3 | azureBlobStorage'
required: false
storage-name:
description: 'In case of AWS/GCS, use the bucket name. In case of Azure, use container name.'
required: false
aws-region:
description: 'AWS Region'
required: false
default: 'eu-central-1'
aws-access-key-id:
description: 'AWS Access Key ID'
required: false
aws-secret-access-key:
description: 'AWS Secret Access Key'
required: false
azure-account-name:
description: 'Azure Account Name'
required: false
azure-account-key:
description: 'Azure Account Name'
required: false
additional-plugins:
description: 'List of additional python plugins to use for site creation'
required: false
skip-publish:
description: 'Indicates whether publish step should be skipped'
required: false
default: 'false'
runs:
using: "composite"
steps:
- name: Setup Node
uses: actions/setup-node@v4
- name: Setup Python
uses: actions/setup-python@v5
- name: Install techdocs-cli
shell: bash
run: sudo npm install -g @techdocs/cli
- name: Install mkdocs and mkdocs plugins
shell: bash
run: python -m pip install mkdocs-techdocs-core==1.*
- name: Install additional plugins
if: inputs.additional-plugins != ''
shell: bash
run: |
for p in ${{ inputs.additional-plugins }}
do
python -m pip install $p
done
- name: Generate docs site
shell: bash
run: techdocs-cli generate --no-docker --verbose
- name: Publish TechDocs site to AWS S3
if: inputs.skip-publish == 'false' && inputs.publisher-type == 'awsS3' && inputs.aws-access-key-id != '' && inputs.aws-secret-access-key != '' && inputs.aws-region != ''
shell: bash
env:
AWS_ACCESS_KEY_ID: ${{ inputs.aws-access-key-id }}
AWS_SECRET_ACCESS_KEY: ${{ inputs.aws-secret-access-key }}
AWS_REGION: ${{ inputs.aws-region }}
run: |
techdocs-cli publish --publisher-type ${{ inputs.publisher-type }} \
--storage-name ${{ inputs.storage-name }} \
--entity ${{ inputs.entity-namespace }}/${{ inputs.entity-kind }}/${{ inputs.entity-name }}
- name: Publish TechDocs site to Azure Blob
if: inputs.skip-publish == 'false' && inputs.publisher-type == 'azureBlobStorage' && inputs.azure-account-name != '' && inputs.azure-account-key != ''
shell: bash
run: |
techdocs-cli publish --publisher-type ${{ inputs.publisher-type }} \
--storage-name ${{ inputs.storage-name }} \
--entity ${{ inputs.entity-namespace }}/${{ inputs.entity-kind }}/${{ inputs.entity-name }} \
--azureAccountName ${{ inputs.azure-account-name }} \
--azureAccountKey ${{ inputs.azure-account-key }}
branding:
icon: 'check-square'
color: 'blue'