Skip to content

Commit

Permalink
Trigger doc workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Tides committed Nov 26, 2024
1 parent dec1af4 commit 8980ca2
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 48 deletions.
69 changes: 21 additions & 48 deletions .github/workflows/docfx.yml
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\"}"
8 changes: 8 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,16 @@ name: .NET Build
on:
push:
branches: [ 1.* ]
paths:
- "**/*.cs"
- "**/*.csproj"
- "./github/workflows/dotnet.yml"
pull_request:
branches: [ 1.* ]
paths:
- "**/*.cs"
- "**/*.csproj"
- "./github/workflows/dotnet.yml"

jobs:
build:
Expand Down

0 comments on commit 8980ca2

Please sign in to comment.