Merge pull request #49 from mattimustang/patch-1 #135
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update Wiki | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- '.github/workflows/wiki.yml' | |
- 'src/**' | |
- 'build/*Wiki.ps1' | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Checkout Code" | |
uses: actions/Checkout@v2 | |
- name: "Generate Pages" | |
run: | | |
Install-Module -Name "Microsoft.Graph.Authentication" -RequiredVersion "2.8.0" -Force | |
./Build-Wiki.ps1 | |
shell: pwsh | |
working-directory: ./build | |
- name: "Upload Wiki" | |
run: | | |
echo "set git user" | |
git config --global user.email "[email protected]" | |
git config --global user.name "Github Action" | |
echo "clone the remote wiki" | |
git clone https://githubaction:[email protected]/$GITHUB_REPOSITORY.wiki.git tmp.wiki | |
cd tmp.wiki | |
echo "copy generated files" | |
cp -f ../.wiki/*.md ./ | |
echo "add generated files" | |
git add -A | |
echo "commit new wiki" | |
git commit --allow-empty -m "update wiki $GITHUB_SHA" | |
echo "push to wiki" | |
git push | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |