Docs build and deploy #1538
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | |
DOTNET_CLI_TELEMETRY_OPTOUT: 1 | |
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 | |
node_version: 20.x | |
NUKE_TELEMETRY_OPTOUT: true | |
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: Install .NET 8.0.x | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 8.0.x | |
- name: Build & Deploy docs preview | |
run: | | |
./build.sh 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 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 }} |