Skip to content

Replace c# code with csharp #882

Replace c# code with csharp

Replace c# code with csharp #882

name: Build Documentation
# repository_dispatch is used to trigger the flow from Npgsql/EFCore.PG via HTTP POST
on: [push, pull_request, repository_dispatch]
jobs:
build:
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4.0.4
with:
node-version: 20.x
- name: Run Markdownlint
run: |
echo "::add-matcher::.github/workflows/markdownlint-problem-matcher.json"
npm i -g markdownlint-cli
markdownlint "conceptual/**/*.md"
- name: Checkout live branch
uses: actions/checkout@v4
with:
ref: live
path: live
- name: Clear live docs repo
run: rm -rf live/*
- name: Checkout Npgsql
uses: actions/checkout@v4
with:
repository: npgsql/npgsql
ref: docs
path: Npgsql
# Setup software
- name: Setup .NET Core
uses: actions/setup-dotnet@v4.0.1
with:
dotnet-version: 7.0.x
# docfx has issues specifically with analyzer/sourcegen projects; build manually before
- name: Build Npgsql
run: dotnet build -c Release
shell: bash
working-directory: Npgsql
- name: Checkout EFCore.PG
uses: actions/checkout@v4
with:
repository: npgsql/Npgsql.EntityFrameworkCore.PostgreSQL
ref: docs
path: EFCore.PG
- name: Build EFCore.PG
run: dotnet build -c Release
shell: bash
working-directory: EFCore.PG
# Note:
# Since we use a custom template to override some properties of the docfx default template, when upgrading docfx we should check
# whether the default template of the new docfx version has changes we need to carry over to our modified version.
# You can get the docfx default template via the following command: docfx template export default
# This will put the default template folder into a directory called _exported_templates
- name: Get docfx
run: dotnet tool install --version 2.77.0 -g docfx
- name: Build docs
run: docfx --warningsAsErrors
- name: Commit and push
if: (github.event_name == 'push' || github.event_name == 'repository_dispatch') && github.repository == 'npgsql/doc' && github.ref == 'refs/heads/main'
run: |
export GIT_COMMITTER_NAME=$(git show -s --format='%cn')
export GIT_COMMITTER_EMAIL=$(git show -s --format='%ce')
export GIT_AUTHOR_NAME=$(git show -s --format='%an')
export GIT_AUTHOR_EMAIL=$(git show -s --format='%ae')
export COMMIT_HASH=$(git show -s --format='%H')
export SUBJECT=$(git show -s --format='%s')
cd live
git add .
git commit -m "$SUBJECT" -m "Original commit: $COMMIT_HASH"
git push origin HEAD:live