Skip to content

Commit fd42e34

Browse files
authored
Generate specific Registry Documentation format by Release (#58)
1 parent 09ce47d commit fd42e34

34 files changed

+227
-78
lines changed

.github/boring-cyborg.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ labelPRBasedOnFilePath:
66
chore:
77
- .github/**
88
documentations:
9-
- docs/**
9+
- documentation/**
1010
- mkdocs.yml
1111
- .github/ISSUE_TEMPLATE/**
12-
- .github/pull_request_template.md
12+
- .github/pull_request_template.md

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ More informations about the Documentation process can be found at
1111
https://nolte.github.io/terraform-provider-harbor/guides/development/#docs
1212
--->
1313
### Documentation
14-
- [ ] Have you create or updated the provider documentation at ``./docs``?
14+
- [ ] Have you create or updated the provider documentation at ``./documentation/provider_doc``?
1515
- [ ] If **new** resources or datasource documentation happen, did you add this to the `mkdocs.yml` configuration?
1616

1717
### References

.github/workflows/cicd-docs.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Release Flow
2+
3+
on:
4+
push:
5+
branches:
6+
- "**"
7+
jobs:
8+
docs:
9+
name: Publish the HTML Documentation
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout master
13+
uses: actions/checkout@v1
14+
- name: Set up Python
15+
uses: actions/setup-python@v2
16+
with:
17+
python-version: "3.8"
18+
- name: Set up Go 1.x
19+
uses: actions/setup-go@v2
20+
with:
21+
go-version: ^1.14
22+
id: go
23+
24+
- uses: actions/cache@v2
25+
with:
26+
path: ~/go/pkg/mod
27+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
28+
restore-keys: |
29+
${{ runner.os }}-go-
30+
- name: Install dependencies
31+
run: |
32+
python -m pip install --upgrade pip
33+
pip install MarkdownPP mkdocs
34+
- name: Install dependencies
35+
run: |
36+
cd ./documentation && go run mage.go -v GenerateDocumation
37+
#- name: Deploy docs
38+
# uses: mhausenblas/mkdocs-deploy-gh-pages@master
39+
# env:
40+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/cicd-release.yml

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,43 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Checkout master
12-
uses: actions/checkout@v1
12+
uses: actions/[email protected]
13+
- name: Set up Python
14+
uses: actions/setup-python@v2
15+
with:
16+
python-version: "3.8"
17+
- name: Set up Go 1.x
18+
uses: actions/setup-go@v2
19+
with:
20+
go-version: ^1.14
21+
id: go
22+
23+
- uses: actions/cache@v2
24+
with:
25+
path: ~/go/pkg/mod
26+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
27+
restore-keys: |
28+
${{ runner.os }}-go-
29+
30+
- name: Install dependencies
31+
run: |
32+
python -m pip install --upgrade pip
33+
pip install MarkdownPP mkdocs
34+
- name: Install dependencies
35+
run: |
36+
cd ./documentation && go run mage.go -v GenerateDocumation
37+
- uses: EndBug/add-and-commit@v4 # You can change this to use a specific version
38+
with:
39+
add: 'docs'
40+
force: true
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
- uses: EndBug/add-and-commit@v4 # You can change this to use a specific version
44+
with:
45+
add: 'documentation/provider_doc'
46+
force: true
47+
env:
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1349

1450
- name: Deploy docs
1551
uses: mhausenblas/mkdocs-deploy-gh-pages@master

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ terraform-provider-harbor_*
22
gen
33
bin
44
dist
5+
docs
56

67
# Local .terraform directories
78
**/.terraform/*
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

documentation/go.mod

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module main
2+
3+
go 1.14
4+
5+
require (
6+
github.com/magefile/mage v1.10.0
7+
github.com/otiai10/copy v1.2.0
8+
)

0 commit comments

Comments
 (0)