Skip to content

Commit 632165e

Browse files
authored
Merge pull request #278 from awslabs/s3-docs
feat(docs): Start S3 Docs
2 parents 63778f0 + f7380ed commit 632165e

File tree

4 files changed

+63
-61
lines changed

4 files changed

+63
-61
lines changed

.github/workflows/docs.yml

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,19 @@ on:
55
branches:
66
- main
77

8+
permissions:
9+
id-token: write
10+
contents: write
11+
pages: write
12+
813
jobs:
914
docs:
1015
# Force Github action to run only a single job at a time (based on the group name)
1116
# This is to prevent "race-condition" in publishing a new version of doc to `gh-pages`
1217
concurrency:
1318
group: on-docs-build
1419
runs-on: ubuntu-latest
20+
environment: Docs
1521
steps:
1622
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
1723
with:
@@ -32,29 +38,46 @@ jobs:
3238
with:
3339
github_token: ${{ secrets.GITHUB_TOKEN }}
3440
publish_dir: ./dist
41+
- name: Configure AWS credentials
42+
uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef
43+
with:
44+
aws-region: us-east-1
45+
role-to-assume: ${{ secrets.AWS_DOCS_ROLE_ARN }}
46+
- name: Deploy Docs
47+
run: |
48+
aws s3 sync \
49+
dist \
50+
s3://${{ secrets.AWS_DOCS_BUCKET }}/lambda-dotnet/
3551
apidocs:
3652
# Force Github action to run only a single job at a time (based on the group name)
3753
# This is to prevent "race-condition" in publishing a new version of doc to `gh-pages`
3854
concurrency:
3955
group: on-docs-build
4056
runs-on: ubuntu-latest
57+
environment: Docs
4158
steps:
4259
- uses: actions/checkout@v3
4360
- name: Setup .NET 6.0
4461
uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a
4562
with:
4663
dotnet-version: 6.0.405
47-
- name: Install solution dependencies
48-
run: |
49-
dotnet new tool-manifest
50-
dotnet tool install docfx
51-
- name: Create API docs
52-
run: |
53-
dotnet docfx apidocs/docfx.json
64+
- uses: nikeee/docfx-action@b9c2cf92e3b4aa06878a1410833a8828b4bdcd26 #1.0.0
65+
name: Build Documentation
66+
with:
67+
args: apidocs/docfx.json
5468
- name: Release API docs to latest
5569
uses: peaceiris/actions-gh-pages@bd8c6b06eba6b3d25d72b7a1767993c0aeee42e7 # v3.9.2
5670
with:
5771
github_token: ${{ secrets.GITHUB_TOKEN }}
5872
publish_dir: ./apidocs/_site
59-
keep_files: true
6073
destination_dir: api
74+
- name: Configure AWS credentials
75+
uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef
76+
with:
77+
aws-region: us-east-1
78+
role-to-assume: ${{ secrets.AWS_DOCS_ROLE_ARN }}
79+
- name: Deploy Docs
80+
run: |
81+
aws s3 sync \
82+
apidocs/_site \
83+
s3://${{ secrets.AWS_DOCS_BUCKET }}/lambda-dotnet/api/

.github/workflows/on_push_docs.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

.github/workflows/reusable_publish_docs.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ on:
2222
type: boolean
2323

2424
permissions:
25+
id-token: write
2526
contents: write
2627
pages: write
2728

@@ -32,6 +33,7 @@ jobs:
3233
concurrency:
3334
group: on-docs-rebuild
3435
runs-on: ubuntu-latest
36+
environment: Docs
3537
steps:
3638
- uses: actions/checkout@v3
3739
with:
@@ -82,13 +84,25 @@ jobs:
8284
keep_files: true
8385
destination_dir: latest/api
8486

87+
- name: Configure AWS credentials
88+
uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef
89+
with:
90+
aws-region: us-east-1
91+
role-to-assume: ${{ secrets.AWS_DOCS_ROLE_ARN }}
92+
- name: Deploy Docs
93+
run: |
94+
aws s3 sync \
95+
dist \
96+
s3://${{ secrets.AWS_DOCS_BUCKET }}/lambda-dotnet/
97+
8598
8699
apidocs:
87100
# Force Github action to run only a single job at a time (based on the group name)
88101
# This is to prevent "race-condition" in publishing a new version of doc to `gh-pages`
89102
concurrency:
90103
group: on-docs-build
91104
runs-on: macos-latest
105+
environment: Docs
92106
steps:
93107
- uses: actions/checkout@v3
94108
with:
@@ -103,4 +117,14 @@ jobs:
103117
github_token: ${{ secrets.GITHUB_TOKEN }}
104118
publish_dir: ./apidocs/_site
105119
keep_files: true
106-
destination_dir: api
120+
destination_dir: api
121+
- name: Configure AWS credentials
122+
uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef
123+
with:
124+
aws-region: us-east-1
125+
role-to-assume: ${{ secrets.AWS_DOCS_ROLE_ARN }}
126+
- name: Deploy Docs
127+
run: |
128+
aws s3 sync \
129+
apidocs/_site \
130+
s3://${{ secrets.AWS_DOCS_BUCKET }}/lambda-dotnet/api/

apidocs/docfx.json

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@
33
{
44
"src": [
55
{
6-
"files": [
7-
"**/*.csproj"
8-
],
9-
"src": "../libraries/src/",
10-
"force": true
6+
"files": ["**/*.csproj"],
7+
"src": "../libraries/src/"
118
}
129
],
1310
"dest": "api",
@@ -21,23 +18,16 @@
2118
"build": {
2219
"content": [
2320
{
24-
"files": ["api/**.yml", "api/index.md"]
21+
"files": ["api/**"]
2522
},
2623
{
27-
"files": ["toc.yml", "*.md"]
24+
"files": ["toc.yml", "*.md"],
25+
"exclude": ["_site/**", "**/bin/**", "**/obj/**", "**/[Tt]ests/**"]
2826
}
2927
],
3028
"resource": [
3129
{
32-
"files": [
33-
"images/**"
34-
]
35-
}
36-
],
37-
"overwrite": [
38-
{
39-
"files": ["apidoc/**.md"],
40-
"exclude": ["obj/**", "_site/**"]
30+
"files": ["images/**"]
4131
}
4232
],
4333
"dest": "_site",
@@ -60,4 +50,4 @@
6050
"cleanupCacheHistory": false,
6151
"disableGitFeatures": false
6252
}
63-
}
53+
}

0 commit comments

Comments
 (0)