Update GitHub Actions workflows to latest (#34) #43
Workflow file for this run
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: Update Docs | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- '*' | |
jobs: | |
docs: | |
runs-on: macos-12 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
path: master-branch | |
- uses: actions/checkout@v4 | |
with: | |
ref: docs | |
path: docs-branch | |
- name: Update docs | |
run: | | |
cd master-branch | |
git fetch --prune --unshallow --tags | |
version="$(git describe --abbrev=0 --tags)" | |
for v in `sort -ruV <(printf '%s\n%s' "${version}" "$(ls ../docs-branch/versions)")`; do | |
base="$(basename "${v}")" | |
echo "- [${base}](/versions/${base})" >> "Guides/Versions.md" | |
done | |
sudo gem install jazzy | |
./generate-docs.sh "${GITHUB_SHA}" "${version}" | |
cd ../docs-branch | |
mkdir -p versions | |
[[ -e "versions/${version}" ]] && rm -rf "versions/${version}" | |
mv ../docs-perm "versions/${version}" | |
mv versions .git ../docs | |
cd ../docs | |
git config --global user.name "${GITHUB_ACTOR}" | |
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
git add -A | |
git commit -m "[docs] Update to ${version}" | |
git push |