-
Notifications
You must be signed in to change notification settings - Fork 20
65 lines (65 loc) · 3.35 KB
/
ci.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
60
61
62
63
64
65
name: ci
on:
workflow_dispatch:
push:
branches:
- 1.3.0
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: 1.3.0
path: ./tmp-update-repo
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v3
with:
fetch-depth: 1
repository: esmero/archipelago-deployment
ref: 1.3.0
path: ./archipelago-deployment
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v3
with:
fetch-depth: 1
repository: esmero/archipelago-deployment-live
ref: 1.3.0
path: ./archipelago-deployment-live
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-python@v4
with:
python-version: 3.x
- run: |
pip install mkdocs-material mike git+https://github.com/jldiaz/mkdocs-plugin-tags.git mkdocs-git-revision-date-localized-plugin mkdocs-glightbox
rm ./tmp-update-repo/docs/archipelago-deployment-*.md
cp ./archipelago-deployment/README.md ./tmp-update-repo/docs/archipelago-deployment-readme.md
cp ./archipelago-deployment-live/README.md ./tmp-update-repo/docs/archipelago-deployment-live-readme.md
for f in ./archipelago-deployment/docs/*.md; do cp -- "$f" "./tmp-update-repo/docs/archipelago-deployment-$(basename $f)"; done
for f in ./archipelago-deployment/docs/*.md; do for g in ./archipelago-deployment/docs/*.md; do sed -i "s/$(basename $g)/archipelago-deployment-$(basename $g)/g" "./tmp-update-repo/docs/archipelago-deployment-$(basename $f)"; done; done
for f in ./archipelago-deployment-live/docs/*.md; do cp -- "$f" "./tmp-update-repo/docs/archipelago-deployment-live-$(basename $f)"; done
for f in ./archipelago-deployment-live/docs/*.md; do for g in ./archipelago-deployment-live/docs/*.md; do sed -i "s/$(basename $g)/archipelago-deployment-live-$(basename $g)/g" "./tmp-update-repo/docs/archipelago-deployment-live-$(basename $f)"; done; done
rm -r ./archipelago-deployment
rm -r ./archipelago-deployment-live
cd tmp-update-repo
sed -i '/<!--documentation/d;/documentation-->/d;s/docs\//archipelago-deployment-/g' docs/archipelago-deployment-*.md
sed -i '/<!--switch_below/d;/<!--switch_above/d;s/switch_above-->/repo_docs-->/g;s/switch_below-->/<!--repo_docs/g' docs/archipelago-deployment-*.md
sed -i 's/..\/README.md/archipelago-deployment-live-readme.md/g' docs/archipelago-deployment-live-*.md
git config --global user.name github-bot-metro
git config --global user.email github-bot@metro.org
git add . &&
git commit -m "sync repo docs" || echo "No changes to commit" &&
git push origin 1.3.0 &&
cd .. &&
rm -r ./tmp-update-repo &&
git pull origin 1.3.0 &&
git fetch origin gh-pages --depth=1 &&
# no making it default yet, but the previous command was missing the action
#mike deploy --update-aliases 1.3.0 &&
mike deploy --update-aliases --push 1.3.0 || echo "No changes to commit"
mike set-default --push 1.3.0 || echo "No changes to commit"