-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
29 additions
and
48 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,27 @@ | ||
name: .NET Docs | ||
name: Update Docs | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- 1.* | ||
branches: [1.*] | ||
paths: | ||
- 'Obsidian.Docs/**' | ||
env: | ||
DOTNET_NOLOGO: true | ||
DOTNET_CLI_TELEMETRY_OPTOUT: true | ||
permissions: | ||
contents: write | ||
- "**/*.cs" | ||
- "**/*.csproj" | ||
- "./github/workflows/docfx.yml" | ||
jobs: | ||
build: | ||
trigger: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: 9.0.0 | ||
- name: Install DocFX | ||
run: dotnet tool update -g docfx | ||
continue-on-error: true | ||
- name: Build Obsidian | ||
run: dotnet build | ||
- name: Build documentation | ||
run: docfx Obsidian.Docs/docfx.json | ||
- name: Upload GitHub Pages artifact | ||
uses: actions/upload-pages-artifact@v1 | ||
with: | ||
# Path of the directory containing the static assets. | ||
path: ./Obsidian.Docs/_site/ # default is _site/ | ||
deploy: | ||
# Add a dependency to the build job | ||
needs: build | ||
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment | ||
permissions: | ||
pages: write # to deploy to Pages | ||
id-token: write # to verify the deployment originates from an appropriate source | ||
# Deploy to the github-pages environment | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
# Specify runner + deployment step | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v1 | ||
- name: Trigger Workflow in Another Repository | ||
run: | | ||
# Set the required variables | ||
repo_owner="ObsidianMC" | ||
repo_name="Documentation" | ||
event_type="trigger-workflow" | ||
curl -L \ | ||
-X POST \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "Authorization: Bearer ${{ secrets.WORKFLOW_TOKEN }}" \ | ||
https://api.github.com/repos/$repo_owner/$repo_name/dispatches \ | ||
-d "{\"event_type\": \"$event_type\"}" |
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