Update main.yml #1
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 and Publish Docs | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
defaults: | ||
run: | ||
working-directory: ./EXILED | ||
env: | ||
EXILED_REFERENCES_URL: https://misaka-zerotwo.github.io/SL-References/Master.zip | ||
EXILED_REFERENCES_PATH: ${{ github.workspace }}/EXILED/References | ||
jobs: | ||
build_and_publish_docs: | ||
runs-on: windows-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2.3.4 | ||
- name: Setup .NET Core SDK | ||
uses: actions/setup-dotnet@v1.7.2 | ||
- name: Setup Nuget | ||
uses: iRebbok/setup-nuget@master | ||
- name: Get references | ||
shell: pwsh | ||
run: | | ||
Check failure on line 35 in .github/workflows/docs.yml GitHub Actions / Build and Publish DocsInvalid workflow file
|
||
Invoke-WebRequest -Uri ${{ EXILED_REFERENCES_URL }} -OutFile ${{ github.workspace }}/EXILED/References.zip | ||
Expand-Archive -Path References.zip -DestinationPath ${{ env.EXILED_REFERENCES_PATH }} | ||
- name: Download DocFX | ||
uses: crazy-max/ghaction-chocolatey@v1 | ||
with: | ||
args: install docfx --pre | ||
- name: Run DocFX | ||
env: | ||
EXILED_REFERENCES: ${{ env.EXILED_REFERENCES_PATH }} | ||
run: docfx docfx.json; docfx docfx.json | ||
- name: Deploy to GitHub Pages | ||
if: github.event_name == 'push' && success() #Only publishes on push to master to avoid docs mishaps | ||
uses: crazy-max/ghaction-github-pages@v2 | ||
with: | ||
target_branch: gh-pages | ||
build_dir: _site | ||
keep_history: true | ||
jekyll: false | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |