Merge pull request #181 from aksm/ISSUE-179 #151
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ci | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- 1.1.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.1.0 | |
path: ./tmp-update-repo | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
repository: esmero/archipelago-deployment | |
ref: 1.1.0 | |
path: ./archipelago-deployment | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
repository: esmero/archipelago-deployment-live | |
ref: 1.1.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 [email protected] | |
git add . && | |
git commit -m "sync repo docs" || echo "No changes to commit" && | |
git push origin 1.1.0 && | |
cd .. && | |
rm -r ./tmp-update-repo && | |
git pull origin 1.1.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.1.0 && | |
#mike set-default --push 1.1.0 || echo "No changes to commit" | |
mike deploy --update-aliases --push 1.1.0 || echo "No changes to commit" |