Refactor game design documentation #62
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: Build Docs and Deploy to Github Pages | |
on: | |
push: | |
branches: | |
- main | |
- documentation | |
paths: | |
- "docs/**" | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: Build and Deploy Documentation | |
env: | |
GODOT_VERSION: 4.4-rc2 # alterar ao atualizar o Godot | |
GODOT_FILENAME: Godot_v4.4-rc2_mono_linux_x86_64.zip # alterar ao atualizar o Godot | |
GODOT_URL: https://github.com/godotengine/godot-builds/releases/download/4.4-rc2/Godot_v4.4-rc2_mono_linux_x86_64.zip # alterar isso ao atualizar o Godot | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Set Environment Variable | |
run: echo "GITHUB_ACTIONS=true" >> $GITHUB_ENV | |
- name: Set up .NET 9 SDK | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: "9" | |
- name: Install Dependencies (Mono, unzip) | |
run: sudo apt-get update && sudo apt-get install -y mono-complete unzip | |
- name: Install Godot ${{ env.GODOT_VERSION }} | |
run: | | |
wget -q ${{ env.GODOT_URL }} | |
unzip ${{ env.GODOT_FILENAME }} -d /usr/local/bin | |
mv /usr/local/bin/Godot_v${{ env.GODOT_VERSION }}_mono_linux_x86_64 /usr/local/bin/godot | |
chmod +x /usr/local/bin/godot | |
- name: Install DocFX | |
run: dotnet tool install -g docfx | |
- name: Build Documentation with DocFX | |
run: docfx | |
- name: Install Packages in docs Folder | |
run: npm install | |
working-directory: docs | |
- name: Process API Files | |
run: npm run process-api | |
working-directory: docs | |
- name: Build Documentation | |
run: npm run build | |
working-directory: docs | |
- name: Upload Pages Artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: ./docs/build | |
deploy: | |
needs: build | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |