Skip to content

Commit

Permalink
ci: try a new approach for getting docs building
Browse files Browse the repository at this point in the history
  • Loading branch information
bdunderscore committed Sep 12, 2023
1 parent 88e4045 commit dcff974
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 83 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Build documentation

on:
push:
branches: [main]
pull_request: {}
workflow_dispatch: {}

jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: nikeee/[email protected]
name: Build Documentation
with:
args: docfx~/docfx.json

- uses: actions/upload-artifact@v3
if: always()
with:
name: docs
path: docfx~/_site

publish-docs:
if: github.ref == 'refs/heads/main' && github.repository == 'bdunderscore/ndmf'
permissions:
contents: read
pages: write
id-token: write
runs-on: ubuntu-latest
concurrency:
group: docs-publish
cancel-in-progress: true
needs: build-docs
steps:
- uses: actions/download-artifact@v3
with:
name: docs
path: docs

- name: Setup Pages
uses: actions/configure-pages@v3

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: docs

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
79 changes: 1 addition & 78 deletions .github/workflows/gameci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,54 +37,6 @@ on:
permissions: {}

jobs:
build-docs:
runs-on: ubuntu-latest
permissions:
checks: write
contents: read
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}

- run: |
mkdir .github/ProjectRoot/Packages/nadena.dev.ndmf -p
mv [^P]* .github/ProjectRoot/Packages/nadena.dev.ndmf
mv .github/ProjectRoot/* .
mv 'Packages/nadena.dev.ndmf/UnitTests~' 'Packages/nadena.dev.ndmf/UnitTests'
- uses: anatawa12/sh-actions/resolve-vpm-packages@master

- run: |
ls -lR
- run: |
ls -lR Packages/nadena*
- uses: actions/cache@v3
with:
path: Library
key: docs-Library-${{ matrix.projectPath }}
restore-keys: Library-

- uses: game-ci/unity-builder@v3
id: docgen
with:
targetPlatform: StandaloneWindows
buildMethod: DocsBuilder.BuildDocs
allowDirtyBuild: true
env:
# meh, just a personal license...
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}

- run: |
ls -lR build
- uses: actions/upload-artifact@v3
if: always()
with:
name: docs
path: build/StandaloneWindows/docs

build-and-test:
runs-on: ubuntu-latest
permissions:
Expand Down Expand Up @@ -137,33 +89,4 @@ jobs:
if: always()
with:
name: Coverage results
path: ${{ steps.gameci.outputs.coveragePath }}

publish-docs:
if: github.ref == 'refs/heads/main' && github.repository == 'bdunderscore/ndmf'
permissions:
contents: read
pages: write
id-token: write
runs-on: ubuntu-latest
concurrency:
group: docs-publish
cancel-in-progress: true
needs: build-docs
steps:
- uses: actions/download-artifact@v3
with:
name: docs
path: docs

- name: Setup Pages
uses: actions/configure-pages@v3

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: docs

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
path: ${{ steps.gameci.outputs.coveragePath }}
22 changes: 17 additions & 5 deletions docfx~/docfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
{
"src": [
{
"cwd": "../../..",
"cwd": "..",
"files": [
"nadena.dev.ndmf.csproj",
"nadena.dev.ndmf.runtime.csproj"
"**/*.cs"
]
}
],
Expand All @@ -18,10 +17,17 @@
"namespaceLayout": "flattened",
"memberLayout": "samePage",
"EnumSortOrder": "alphabetic",
"allowCompilationErrors": false
"allowCompilationErrors": true
}
],
"build": {
"globalMetadata": {
"_appTitle": "NDM Framework documentation",
"_enableSearch": true
},
"sitemap": {
"baseUrl": "https://ndmf.nadena.dev"
},
"content": [
{
"files": [
Expand Down Expand Up @@ -54,6 +60,12 @@
],
"postProcessors": [],
"keepFileLink": false,
"disableGitFeatures": false
"disableGitFeatures": false,
"xref": [
"https://normanderwan.github.io/UnityXrefMaps/2018.4/xrefmap.yml"
],
"xrefService": [
"https://xref.docs.microsoft.com/query?uid={uid}"
]
}
}

0 comments on commit dcff974

Please sign in to comment.