-
Notifications
You must be signed in to change notification settings - Fork 16
59 lines (44 loc) · 1.58 KB
/
main.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
name: Build site
on:
workflow_dispatch:
push:
branches:
- main
jobs:
publish:
name: Publish to retype branch
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
#- name: Clean existing retype branch
#run: |
#git push -d origin retype
- name: Symlink stuff for redirecton
run: |
_links=(
"gearlock/user-guide/getting-geardump.md|common-issues/gathering-logs.md"
)
exit 0; # Temporarily disable this
for _link in "${_links[@]}"; do {
_caller="${_link%%|*}";
_target="${_link##*|}";
ln -srf "$_target" "$_caller";
unset _caller _target;
} done
- uses: retypeapp/action-build@v1
- name: Change /blob/ with /edit/
run: |
# Change /blob/ route to /edit/
_retype_tmpdir="$(find /tmp/tmp* -mindepth 0 -maxdepth 1 -type f \( -name "404.html" -o -name "index.html" \) | head -n1)";
cd "${_retype_tmpdir%/*}";
while read -r _file; do {
sed -i 's|https://github.com/supremegamers/wiki/blob/main/|https://github.com/supremegamers/wiki/edit/main/|g' "$_file";
} done < <(grep -lr 'https://github.com/supremegamers/wiki/blob/main/')
- uses: retypeapp/action-github-pages@v1
with:
update-branch: true