Deploy Documentation #5
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: Deploy Documentation | |
on: | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: 'Git Tag' | |
required: true | |
permissions: | |
contents: write | |
jobs: | |
docs: | |
name: Update openhv.readthedocs.io | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Clone Repository | |
uses: actions/checkout@v4 | |
with: | |
repository: openhv/openhv | |
ref: ${{ github.event.inputs.tag }} | |
- name: Install .NET 6 | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '6.0.x' | |
- name: Prepare Environment | |
run: | | |
make all | |
- name: Clone OpenHV docs | |
uses: actions/checkout@v4 | |
with: | |
path: docs | |
- name: Update openhv/docs | |
env: | |
GIT_TAG: ${{ github.event.inputs.tag }} | |
run: | | |
./utility.sh --docs "${GIT_TAG}" | python3 ./engine/packaging/format-docs.py > "traits.md" | |
sed "s/of OpenRA/of OpenHV/g" "traits.md" > "docs/api/release/traits.md" | |
sed -i '/^## /d' docs/api/release/traits.md | |
./utility.sh --weapon-docs "${GIT_TAG}" | python3 ./engine/packaging/format-docs.py > "weapons.md" | |
sed "s/of OpenRA/of OpenHV/g" "weapons.md" > "docs/api/release/weapons.md" | |
sed -i '/^## /d' docs/api/release/weapons.md | |
./utility.sh --sprite-sequence-docs "${GIT_TAG}" | python3 ./engine/packaging/format-docs.py > "sprites.md" | |
sed "s/of OpenRA/of OpenHV/g" "sprites.md" > "docs/api/release/sprites.md" | |
sed -i '/^## /d' docs/api/release/sprites.md | |
./utility.sh --lua-docs "${GIT_TAG}" > "lua.md" | |
sed "s/of OpenRA/of OpenHV/g" "lua.md" | sed "s/OpenRA allows/OpenHV allows/g" > "docs/api/release/lua.md" | |
- name: Push openhv/docs | |
env: | |
GIT_TAG: ${{ github.event.inputs.tag }} | |
run: | | |
cd docs | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Actions" | |
git add --all | |
git commit -m "Update auto-generated documentation for ${GIT_TAG}" | |
git push origin main | |