-
Notifications
You must be signed in to change notification settings - Fork 48
42 lines (39 loc) · 1.1 KB
/
wiki.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
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 "action@github.com"
git config --global user.name "Github Action"
echo "clone the remote wiki"
git clone https://githubaction:$GITHUB_TOKEN@github.com/$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 }}