forked from davidlatwe/rez
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (66 loc) · 2.09 KB
/
Copy pathwiki.yaml
File metadata and controls
76 lines (66 loc) · 2.09 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Wiki
on:
push:
paths:
- 'wiki/**'
- src/rez/rezconfig.py
pull_request:
paths:
- 'wiki/**'
- src/rez/rezconfig.py
env:
CLONE_URL: "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.wiki.git"
jobs:
build:
name: Build Wiki Artifact
runs-on: ubuntu-latest
env:
TEMP_WIKI_DIR: "wiki/.rez-gen-wiki-tmp"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Build Wiki
working-directory: wiki # Start in correct dir, else inspect fails
run: |
git config --global color.ui always
if [ "${{ github.event_name == 'pull_request' }}" == "true" ]
then
BRANCH="${{ github.head_ref }}"
else
BRANCH="${{ github.ref }}"
fi
python update-wiki.py \
--keep-temp \
--no-push \
--github-release="$BRANCH" \
--github-branch="${BRANCH##refs*/}" \
--wiki-dir="${{ github.workspace }}"/"${{ env.TEMP_WIKI_DIR }}" \
--wiki-url="${{ env.CLONE_URL }}"
- uses: actions/upload-artifact@v1.0.0
with:
name: wiki-markdown
path: ${{ env.TEMP_WIKI_DIR }}
publish:
name: Publish to GitHub Wiki
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/download-artifact@master
with:
name: wiki-markdown
path: .
- name: Setup git config
run: |
git config --global color.ui always
git config --global user.name "github.com/${{ github.actor }}"
git config --global user.email "${{ github.actor }}@${{ github.sha }}"
- name: Git commit and push
run: |
git commit \
-m "Generated from GitHub "${{ github.workflow }}" Workflow" \
-m "See https://github.com/${{ github.repository }}/runs/${GITHUB_ACTION}" \
|| exit 0
git remote set-url origin "${{ env.CLONE_URL }}"
git push origin master