Skip to content

Commit

Permalink
split jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
archanox committed Jan 1, 2024
1 parent 7abc296 commit db683a4
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 42 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -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
43 changes: 2 additions & 41 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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
if: ${{ always() }}
2 changes: 1 addition & 1 deletion .github/workflows/nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}

0 comments on commit db683a4

Please sign in to comment.