CI_DOCUMENTATION #6
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
# This is a basic workflow to help you get started with Actions | |
name: CI_DOCUMENTATION | |
# Controls when the action will run. Triggers the workflow on push | |
# events but only for the master branch | |
on: | |
workflow_dispatch: | |
inputs: | |
GeneratePR: | |
description: 'Generate the PR at the end' | |
required: true | |
default: false | |
type: boolean | |
# This workflow contains one job called "build_documentation" | |
jobs: | |
build_documentation: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Runs a set of commands using the runners shell | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: '1' | |
submodules: 'true' | |
- name: Clear documentation folder | |
shell: pwsh | |
run: Remove-Item ./docs/* -Recurse -Force -Exclude _config.yml,CNAME | |
- run: dotnet tool update -g docfx | |
- name: Build documentation | |
run: | | |
cd src/documentation | |
docfx | |
- name: Extract commit SHA | |
run: | | |
echo "GITHUB_COMMIT_MESSAGE=$(echo $GITHUB_SHA | cut -c 1-7)" >> $GITHUB_ENV | |
shell: bash | |
- name: Request a PR to commit changes | |
if: ${{ github.repository_owner == 'masesgroup' && inputs.GeneratePR == true }} #do not push any changes outside main repo or GeneratePR is false | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
branch-suffix: short-commit-hash | |
add-paths: docs/*.* | |
commit-message: Update documentation after commit ${{ env.GITHUB_COMMIT_MESSAGE }} | |
title: Changes by GitHub action | |
body: Automated changes by GitHub action | |
reviewers: masesdevelopers | |
assignees: masesdevelopers | |
labels: documentation, enhancement |