diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..186f8bc8 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,54 @@ +name: Routine Docs + +on: + push: + branches-ignore: + - gh-pages + +jobs: + docs: + name: Generate docs + runs-on: windows-latest + steps: + - name: Configure git + run: git config --global core.autocrlf true + - name: Checkout branch + uses: actions/checkout@v2 + - name: Checkout submodules + run: git submodule update --init --recursive + - name: Locate MSBuild + uses: warrenbuckley/Setup-MSBuild@v1 + - name: Setup Nuget + uses: warrenbuckley/Setup-Nuget@v1 + - name: Nuget Restore + run: nuget restore + - name: Install DocFX + uses: crazy-max/ghaction-chocolatey@v1 + with: + args: install docfx -y + - name: Build docs + env: + SOURCE_COMMIT: ${{ github.sha }} + shell: powershell + working-directory: ./docs + run: | + Add-Content link_branch.json "{`"_gitContribute`":{`"sourceBranch`":`"$env:SOURCE_COMMIT`",`"apiSpecFolder`":`"docs/override`"}}" + powershell .\build.ps1 + if ($lastexitcode -ne 0){ + throw [System.Exception] "docfx build failed with exit code $lastexitcode." + } + - name: Publish master site to GitHub pages + uses: seanmiddleditch/gha-publish-to-git@master + with: + branch: gh-pages + github-token: ${{ secrets.pagesCommitToken }} + source_folder: docs/_site + if: github.ref == 'master' + - name: Publish branch site to GitHub pages + uses: seanmiddleditch/gha-publish-to-git@master + with: + branch: gh-pages + github-token: ${{ secrets.pagesCommitToken }} + source_folder: docs/_site + target_folder: branch/${{ github.ref }} + if: github.ref != 'master' diff --git a/.github/workflows/tag_docs.yml b/.github/workflows/tag_docs.yml new file mode 100644 index 00000000..663a02bc --- /dev/null +++ b/.github/workflows/tag_docs.yml @@ -0,0 +1,46 @@ +name: Tag Docs + +on: + release: + types: [created] + +jobs: + docs: + name: Generate docs + runs-on: windows-latest + steps: + - name: Configure git + run: git config --global core.autocrlf true + - name: Checkout branch + uses: actions/checkout@v2 + - name: Checkout submodules + run: git submodule update --init --recursive + - name: Locate MSBuild + uses: warrenbuckley/Setup-MSBuild@v1 + - name: Setup Nuget + uses: warrenbuckley/Setup-Nuget@v1 + - name: Nuget Restore + run: nuget restore + - name: Install DocFX + uses: crazy-max/ghaction-chocolatey@v1 + with: + args: install docfx -y + - name: Build docs + env: + SOURCE_COMMIT: ${{ github.sha }} + shell: powershell + working-directory: ./docs + run: | + Add-Content link_branch.json "{`"_gitContribute`":{`"sourceBranch`":`"$env:SOURCE_COMMIT`",`"apiSpecFolder`":`"docs/override`"}}" + powershell .\build.ps1 + if ($lastexitcode -ne 0){ + throw [System.Exception] "docfx build failed with exit code $lastexitcode." + } + - name: Publish tag site to GitHub pages + uses: seanmiddleditch/gha-publish-to-git@master + with: + branch: gh-pages + github-token: ${{ secrets.pagesCommitToken }} + source_folder: docs/_site + target_folder: tags/${{ github.ref }} + \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml index dbe9b323..8902c8f9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -9,7 +9,7 @@ environment: BuildForBeatSaber: 'false' matrix: - BUILD_DOC: 'no' - - BUILD_DOC: 'yes' + #- BUILD_DOC: 'yes' pull_requests: do_not_increment_build_number: true