Bump actions/download-artifact from 1.0.0 to 4.1.7 in /.github/workflows #183
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: Nightly Docs | |
on: | |
push: | |
branches: | |
- main | |
pull_request_target: | |
types: [opened, synchronize, reopened, closed, labeled, unlabeled] | |
jobs: | |
build_and_deploy_docs: | |
if: (github.event_name == 'push' || (github.event_name == 'pull_request_target' && github.event.action != 'closed' && github.event.action != 'unlabeled' && contains(github.event.pull_request.labels.*.name, 'pr-generate-docs-preview'))) && github.repository_owner == 'GmodNET' | |
runs-on: ubuntu-latest | |
name: Build and Deploy Nightly Docs | |
steps: | |
- name: Checkout branch | |
if: github.event_name == 'push' | |
uses: actions/[email protected] | |
- name: Checkout PR | |
if: github.event_name != 'push' | |
run: | | |
gh repo clone GmodNET/GmodDotNet ./ | |
gh pr checkout ${{ github.event.number }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Setup .NET SDK | |
uses: actions/[email protected] | |
with: | |
global-json-file: "./global.json" | |
- name: Restore dotnet tools | |
run: dotnet tool restore | |
# We force DocFX to use latest runtime (and latest SDK) by setting DOTNET_ROLL_FORWARD='LatestMajor' env var | |
- name: Build docs with DocFX | |
shell: pwsh | |
run: | | |
$env:GITHUB_ACTIONS='false' | |
$env:DOTNET_ROLL_FORWARD='LatestMajor' | |
dotnet docfx ./docfx_project/docfx.json | |
- name: Upload docs as artifact | |
uses: actions/[email protected] | |
with: | |
name: site | |
path: docfx_project/_site/ | |
- name: Deploy docs | |
uses: Azure/static-web-apps-deploy@v1 | |
with: | |
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_AMBITIOUS_HILL_0F19B7C03 }} | |
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments) | |
action: "upload" | |
###### Repository/Build Configurations - These values can be configured to match your app requirements. ###### | |
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig | |
app_location: "./docfx_project/_site/" # App source code path | |
api_location: "" # Api source code path - optional | |
output_location: "" # Built app content directory - optional | |
skip_app_build: true | |
###### End of Repository/Build Configurations ###### | |
remove_docs_pr_preview: | |
if: github.event_name == 'pull_request_target' && (github.event.action == 'closed' || (github.event.action == 'unlabeled' && github.event.label.name == 'pr-generate-docs-preview')) && github.repository_owner == 'GmodNET' | |
runs-on: ubuntu-latest | |
name: Close Pull Request Docs | |
steps: | |
- name: Close Pull Request | |
uses: Azure/static-web-apps-deploy@v1 | |
with: | |
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_AMBITIOUS_HILL_0F19B7C03 }} | |
action: "close" |