-
Notifications
You must be signed in to change notification settings - Fork 30
60 lines (57 loc) · 1.92 KB
/
doc-builder.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
name: Publish docs via GitHub Pages
on:
push:
branches:
- main
# Allow the workflow to be triggered also manually.
workflow_dispatch:
permissions:
id-token: write
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }}
aws-region: us-west-2
- uses: actions/checkout@v3
with:
fetch-depth: '0'
- uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Setup .NET Core 6.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- run: pip install mkdocs-material==8.2.9
- run: pip install mkdocs-awesome-pages-plugin==2.8.0
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Run Client Generator
run: |
cd ./src/AWS.Deploy.DocGenerator
dotnet run --project ./AWS.Deploy.DocGenerator.csproj
- name: Check For Git Untracked Changes
id: gitcheck
shell: pwsh
run: |
$newFiles=$(git ls-files --others --exclude-standard | wc -l)
$modifiedFiles=$(git diff --name-only | wc -l)
"newFiles=$newFiles" >> $env:GITHUB_OUTPUT
"modifiedFiles=$modifiedFiles" >> $env:GITHUB_OUTPUT
- name: Commit and Push next version
if: steps.gitcheck.outputs.newFiles != 0 || steps.gitcheck.outputs.modifiedFiles != 0
id: commit-push
run: |
git config --global user.email "[email protected]"
git config --global user.name "aws-sdk-dotnet-automation"
git add site/
git commit -m "Update documentation generated by AWS.Deploy.DocGenerator"
git push
- run: mkdocs gh-deploy --force