Skip to content

Docs build and deploy #1511

Docs build and deploy

Docs build and deploy #1511

Workflow file for this run

name: Docs build and deploy
on:
# run it on push to the default repository branch
# push:
# branches: [ master ]
workflow_dispatch:
inputs:
publish_docs:
description: 'Publish docs'
type: boolean
default: true
env:
config: Release
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
node_version: 20.x
jobs:
build-and-test-code:
name: Build and deploy docs to Netlify
# use system defined below in the tests matrix
runs-on: ${{ matrix.os }}
strategy:
# define the test matrix
matrix:
# selected operation systems to run CI
os: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.node_version }}
- name: Build & Deploy docs preview
run: |
./build.sh --no-color publish-docs-preview
if: ${{ github.ref != 'refs/heads/master' && github.event.inputs.publish_docs == 'true' }}
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
- name: Build & Deploy docs
run: |
./build.sh --no-color publish-docs
if: ${{ github.ref == 'refs/heads/master' && (github.event_name == 'push' || github.event.inputs.publish_docs == 'true') }}
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
# - name: Generate Algolia DocSearch index
# uses: darrenjennings/algolia-docsearch-action@master
# if: ${{ github.ref == 'refs/heads/master' && (github.event_name == 'push' || github.event.inputs.publish_docs == 'true') }}
# with:
# algolia_application_id: ${{ secrets.ALGOLIA_APPLICATION_ID }}
# algolia_api_key: ${{ secrets.ALGOLIA_API_KEY }}
# file: 'docs/.vitepress/algolia-config.json'