diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..af9a5e9 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,47 @@ +name: Documentation + +on: + push: + branches: + - main +permissions: + actions: read + pages: write + id-token: write +env: + dotnet-version: 8.0.x + +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + deploy-docs: + name: Deploy Docs + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ env.dotnet-version }} + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --no-restore + + - run: dotnet tool update -g docfx + - run: docfx docfx.json + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + # Upload entire repository + path: "_site" + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 0cc6d19..654d93a 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -1,19 +1,11 @@ -name: .NET Build, Test, and Publish Nuget Package +name: Build & Test on: push: branches: - main -permissions: - actions: read - pages: write - id-token: write env: dotnet-version: 8.0.x - -concurrency: - group: "pages" - cancel-in-progress: false jobs: build: @@ -58,35 +50,4 @@ jobs: with: project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} coverage-reports: "KartaViewSharp.Tests/coverage.net8.0.xml" - if: ${{ always() }} - - deploy-docs: - name: Deploy Docs - needs: [build, test] - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup .NET - uses: actions/setup-dotnet@v4 - with: - dotnet-version: ${{ env.dotnet-version }} - - name: Restore dependencies - run: dotnet restore - - name: Build - run: dotnet build --no-restore - - - run: dotnet tool update -g docfx - - run: docfx docfx.json - - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - # Upload entire repository - path: "_site" - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 \ No newline at end of file + if: ${{ always() }} \ No newline at end of file diff --git a/.github/workflows/nuget.yml b/.github/workflows/nuget.yml index f56414c..0044d1c 100644 --- a/.github/workflows/nuget.yml +++ b/.github/workflows/nuget.yml @@ -18,7 +18,7 @@ jobs: - run: dotnet build --configuration Release KartaViewSharp - name: Create the package run: dotnet pack --configuration Release KartaViewSharp - - name: Publish the package to GPR + - name: Publish the package to nuget run: dotnet nuget push KartaViewSharp/bin/Release/*.nupkg -k $NUGET_AUTH_TOKEN -s https://api.nuget.org/v3/index.json env: NUGET_AUTH_TOKEN: ${{secrets.NUGET_API_KEY}} \ No newline at end of file