-
Notifications
You must be signed in to change notification settings - Fork 514
60 lines (53 loc) · 1.66 KB
/
PublishGitHubPages.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: Generate Resources & Deploy GitHub Pages
on:
push:
branches:
- Master
- Dev
jobs:
GenerateResource:
runs-on: windows-latest
permissions: write-all
# Only when run from the main repo
if: github.repository == 'microsoft/Microsoft365DSC'
steps:
- uses: actions/checkout@v3
- name: Install Modules
shell: powershell
run: |
Import-Module -Name "./Modules/Microsoft365DSC"
Update-M365DSCResourceDocumentationPage -SourcePath ./Modules/Microsoft365DSC
New-M365DSCCmdletDocumentation
- name: Commit files # commit the output folder
if: always()
shell: pwsh
run: |
git config --local user.email "[email protected]"
git config --local user.name "NikCharlebois"
git add D:/a/Microsoft365DSC/Microsoft365DSC/docs/docs/*
git pull
git commit -m "Updated Resources and Cmdlet documentation pages"
git push
$SHA = git rev-parse HEAD
echo "commitid=$SHA" >> $env:GITHUB_OUTPUT
deploy:
needs: GenerateResource
runs-on: ubuntu-latest
permissions:
contents: write
pages: write
# Only when run from the main repo
if: github.repository == 'microsoft/Microsoft365DSC'
steps:
- uses: actions/checkout@v3
with:
ref: ${{ needs.GenerateResource.outputs.commitid }}
- uses: actions/setup-python@v4
with:
python-version: 3.x
- run: |
pip install mkdocs-material
pip install mkdocs-include-dir-to-nav
- name: Deploy
working-directory: ./docs
run: mkdocs gh-deploy --force