-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e97ef65
commit 46d7078
Showing
1 changed file
with
67 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Deploy Documentation | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: 'Git Tag' | ||
required: true | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
docs: | ||
name: Update openhv.readthedocs.io | ||
if: github.repository == 'openhv/docs' | ||
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: | ||
repository: openhv/docs | ||
token: ${{ secrets.DOCS_TOKEN }} | ||
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 | ||