Skip to content

Commit

Permalink
Move update mechanism here.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mailaender committed Sep 12, 2024
1 parent e97ef65 commit 46d7078
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/documentation.yml
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

0 comments on commit 46d7078

Please sign in to comment.