-
-
Notifications
You must be signed in to change notification settings - Fork 126
57 lines (52 loc) · 1.5 KB
/
update-wiki-api.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
name: Generating WIKI API Docs in phoenix github wiki
on:
push:
branches: [ main ]
jobs:
build-tasks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
path: phoenixSrc
- name: Building phoenix and phoenix wiki
run: |
pwd
ls -al
cd phoenixSrc
npm ci
npm run build
ls -al docs
shell: bash
- uses: actions/checkout@v3
with:
repository: ${{github.repository}}.wiki # specify the wiki repo name here.
path: wiki
- name: copying generated API doc files to wiki
run: |
pwd
mkdir -p ./wiki/generatedDocs
rm -rf ./wiki/generatedDocs/*
rsync -a ./phoenixSrc/docs/ ./wiki/generatedDocs
find ./wiki
cd wiki
git add .
git status
shell: bash
- name: Commit new wiki files
run: |
pwd
cd wiki
git config --local user.email "[email protected]"
git config --local user.name "phoenixide"
git add .
git diff-index --quiet HEAD || git commit -m "Adding API docs: ${{ github.event.pull_request.title }}"
git log -1 --stat
shell: bash
- name: Push changes to Github wiki
uses: ad-m/github-push-action@master
with:
repository: ${{github.repository}}.wiki
branch: master
directory: wiki
github_token: ${{ secrets.GITHUB_TOKEN }}