generated from hashicorp/terraform-provider-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 9
54 lines (43 loc) · 1.91 KB
/
docs.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
name: Docs
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout provider
uses: actions/checkout@v4
with:
path: terraform-provider-kestra
- name: Checkout docs
uses: actions/checkout@v4
with:
repository: kestra-io/docs
path: docs
ref: "develop"
token: ${{ secrets.GH_PERSONAL_TOKEN }}
- name: Transform docs for website
run: |
cd terraform-provider-kestra/docs/
find -type f -name "*.md" -exec sed -i 's/subcategory: ""/editLink: false/g' {} +
find . -type f -name "*.md" -exec sed -i 's/```terraform/```hcl/g' {} +
find data-sources -type f -name "*.md" -exec sed -Ei 's/page_title: "([^ ]+).*"/title: \1/g' {} +
find resources -type f -name "*.md" -exec sed -Ei 's/page_title: "([^ ]+).*"/title: \1/g' {} +
find guides -type f -name "*.md" -exec sed -Ei 's/page_title: "([^"]+)"/title: \1/g' {} +
find . -type f -name "*.md" -exec sed -Ei 's/-> (.*)/::alert{type="info"}\n\1\n::/g' {} +
find . -type f -name "*.md" -exec sed -Ei 's/~> (.*)/::alert{type="warning"}\n\1\n::/g' {} +
find . -type f -name "*.md" -exec sed -Ei 's/!> (.*)/::alert{type="danger"}\n\1\n::/g' {} +
sed -Ei 's/page_title: "([^ ]+).*"/title: Provider configurations/g' index.md
sed -Ei 's/^# kestra Provider/# Provider configurations/g' index.md
mv index.md guides/configurations.md
cp -R * ../../docs/content/docs/13.terraform/
- name: Push change to docs
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "feat(docs): update terraform docs"
branch: develop
file_pattern: 'content/docs/13.terraform/*'
repository: "docs"