diff --git a/.github/workflows/docfx.yml b/.github/workflows/docfx.yml index 435c01ff..1eeb1a16 100644 --- a/.github/workflows/docfx.yml +++ b/.github/workflows/docfx.yml @@ -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\"}" diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 92293277..96ad39ac 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -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: