Update jekyll-gh-pages.yml to support submodule of website (#194) #271
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_DOCS | |
# Controls when the action will run. Triggers the workflow on push or pull request | |
# events but only for the master branch | |
on: | |
push: | |
# only trigger on branches, not on tags | |
branches: 'master' | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
check: | |
if: ${{ github.repository_owner == 'masesgroup' }} #do not execute outside main repo | |
name: Check changed files | |
outputs: | |
run_job: ${{ steps.check_files.outputs.run_job }} | |
runs-on: ubuntu-latest | |
steps: | |
- id: get_changed_files | |
uses: masesgroup/retrieve-changed-files@v3 | |
with: | |
format: 'csv' | |
- id: check_files | |
run: | | |
mapfile -d ',' -t added_modified_files < <(printf '%s,' '${{ steps.get_changed_files.outputs.added_modified }}') | |
for added_modified_file in "${added_modified_files[@]}"; do | |
if [[ $added_modified_file == ".github/workflows/docs.yaml"* ]]; then | |
echo "$added_modified_file is under the directory '.github/workflows'." | |
echo "run_job=true" >> $GITHUB_OUTPUT | |
break | |
fi | |
if [[ $added_modified_file == "src/documentation/"* ]]; then | |
echo "$added_modified_file is under the directory 'src/jvm/src/JCOReflector'." | |
echo "run_job=true" >> $GITHUB_OUTPUT | |
break | |
fi | |
if [[ $added_modified_file == "src/jvm/src/"* ]]; then | |
echo "$added_modified_file is under the directory 'src/'." | |
echo "run_job=true" >> $GITHUB_OUTPUT | |
break | |
fi | |
done | |
# This workflow contains a single job called "build" | |
build_docs: | |
needs: check | |
if: needs.check.outputs.run_job == 'true' | |
# The type of runner that the job will run on | |
runs-on: windows-2022 | |
# 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 | |
# Support longpaths | |
- name: Support long paths | |
run: git config --system core.longpaths true | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
submodules: 'true' | |
# Runs a set of commands using the runners shell | |
- name: Build JCOReflectorCLI | |
run: dotnet build --no-incremental --configuration Release /p:Platform="Any CPU" src\net\JCOReflectorCLI.sln | |
# Runs a set of commands using the runners shell | |
- name: Copy configuration file | |
run: | | |
Copy-Item .github\workflows\JCOReflectorCLI_net6.0.runtimeconfig.json -Destination bin\net6.0\MASES.JCOReflectorCLI.runtimeconfig.json -Force | |
Copy-Item .github\workflows\JCOReflectorCLI_net8.0.runtimeconfig.json -Destination bin\net8.0\MASES.JCOReflectorCLI.runtimeconfig.json -Force | |
- name: Switch to master net6.0 help file | |
run: | | |
cd .\docs\net6.0 | |
git checkout master | |
cd ..\.. | |
- name: Switch to master net8.0 help file | |
run: | | |
cd .\docs\net8.0 | |
git checkout master | |
cd ..\.. | |
- name: Switch to master net462 help file | |
run: | | |
cd .\docs\net462 | |
git checkout master | |
cd ..\.. | |
- name: Clear documentation folder | |
run: Get-ChildItem -Path .\docs -Exclude net6.0,net8.0,net462,_config.yml,CNAME,README.md | Remove-Item -Recurse -Force | |
# Runs a set of commands using the runners shell | |
- name: Clean net6.0 help file folders | |
run: Get-ChildItem -Path .\docs\net6.0 -Exclude .git,LICENSE,README.md | Remove-Item -Recurse -Force | |
- name: Clean net8.0 help file folders | |
run: Get-ChildItem -Path .\docs\net8.0 -Exclude .git,LICENSE,README.md | Remove-Item -Recurse -Force | |
- name: Clean net462 help file folders | |
run: Get-ChildItem -Path .\docs\net462 -Exclude .git,LICENSE,README.md | Remove-Item -Recurse -Force | |
- 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)" >> $GITHUB_ENV | |
shell: bash | |
- name: Build net6.0 Java Help files | |
run: dotnet bin\net6.0\MASES.JCOReflectorCLI.dll -JobType BuildDocs -JobFile .github\workflows\builddocs_win19.job -CommitVersion ${{ env.GITHUB_COMMIT_MESSAGE }} -JDKFolder %JAVA_HOME_11_X64% | |
shell: cmd | |
- name: Build net8.0 Java Help files | |
run: dotnet bin\net8.0\MASES.JCOReflectorCLI.dll -JobType BuildDocs -JobFile .github\workflows\builddocs_win19.job -CommitVersion ${{ env.GITHUB_COMMIT_MESSAGE }} -JDKFolder %JAVA_HOME_11_X64% | |
shell: cmd | |
- name: Build net462 Java Help files | |
run: .\bin\net462\MASES.JCOReflectorCLI -JobType BuildDocs -JobFile .github\workflows\builddocs_win19.job -CommitVersion ${{ env.GITHUB_COMMIT_MESSAGE }} -JDKFolder %JAVA_HOME_11_X64% | |
shell: cmd | |
- name: Clean temporary files | |
run: | | |
Remove-Item .\bin\* -Recurse -Force | |
Remove-Item .\src\net\CLI\obj\* -Recurse -Force | |
Remove-Item .\src\net\engine\obj\* -Recurse -Force | |
- name: Commit changes to net6.0 help file | |
run: | | |
cd .\docs\net6.0 | |
%GITHUB_WORKSPACE%\.github\workflows\commit.cmd github-actions 41898282+github-actions[bot]@users.noreply.github.com "Update help file to commit masesgroup/JCOReflector@${{ env.GITHUB_COMMIT_MESSAGE }}" | |
cd ..\..\.. | |
shell: cmd | |
env: | |
GITHUB_WORKSPACE: $GITHUB_WORKSPACE | |
- name: Commit changes to net8.0 help file | |
run: | | |
cd .\docs\net8.0 | |
%GITHUB_WORKSPACE%\.github\workflows\commit.cmd github-actions 41898282+github-actions[bot]@users.noreply.github.com "Update help file to commit masesgroup/JCOReflector@${{ env.GITHUB_COMMIT_MESSAGE }}" | |
cd ..\..\.. | |
shell: cmd | |
env: | |
GITHUB_WORKSPACE: $GITHUB_WORKSPACE | |
- name: Commit changes to net462 help file | |
run: | | |
cd .\docs\net462 | |
%GITHUB_WORKSPACE%\.github\workflows\commit.cmd github-actions 41898282+github-actions[bot]@users.noreply.github.com "Update help file to commit masesgroup/JCOReflector@${{ env.GITHUB_COMMIT_MESSAGE }}" | |
cd ..\..\.. | |
shell: cmd | |
env: | |
GITHUB_WORKSPACE: $GITHUB_WORKSPACE | |
# - name: Commit changes to JCOReflector repo | |
# run: | | |
# cd .\docs\ | |
# %GITHUB_WORKSPACE%\.github\workflows\commit.cmd github-actions 41898282+github-actions[bot]@users.noreply.github.com "Update help submodule after commit ${{ env.GITHUB_COMMIT_MESSAGE }}" | |
# cd .. | |
# shell: cmd | |
# env: | |
# GITHUB_WORKSPACE: $GITHUB_WORKSPACE | |
- name: Push changes to net6.0 help file | |
run: | | |
cd .\docs\net6.0 | |
%GITHUB_WORKSPACE%\.github\workflows\push.cmd %REPO% | |
cd ..\.. | |
shell: cmd | |
env: | |
GITHUB_WORKSPACE: $GITHUB_WORKSPACE | |
SUPER_SECRET: ${{ secrets.DOCS_API_TOKEN_GITHUB }} | |
REPO: masesgroup/NET6Docs | |
- name: Push changes to net8.0 help file | |
run: | | |
cd .\docs\net8.0 | |
%GITHUB_WORKSPACE%\.github\workflows\push.cmd %REPO% | |
cd ..\.. | |
shell: cmd | |
env: | |
GITHUB_WORKSPACE: $GITHUB_WORKSPACE | |
SUPER_SECRET: ${{ secrets.DOCS_API_TOKEN_GITHUB }} | |
REPO: masesgroup/NET8Docs | |
- name: Push changes to net462 help file | |
run: | | |
cd .\docs\net462 | |
%GITHUB_WORKSPACE%\.github\workflows\push.cmd %REPO% | |
cd ..\.. | |
shell: cmd | |
env: | |
GITHUB_WORKSPACE: $GITHUB_WORKSPACE | |
SUPER_SECRET: ${{ secrets.DOCS_API_TOKEN_GITHUB }} | |
REPO: masesgroup/FrameworkDocs | |
- name: Request a PR to commit changes | |
if: ${{ github.repository_owner == 'masesgroup' }} # do not push any changes outside main repo | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
branch-suffix: short-commit-hash | |
add-paths: .\*.* | |
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, java, enhancement, .NET Framework, .NET 6, .NET 8 | |
# - name: Commit changes to JCOReflector | |
# run: | | |
# %GITHUB_WORKSPACE%\.github\workflows\push.cmd %REPO% | |
# shell: cmd | |
# env: | |
# GITHUB_WORKSPACE: $GITHUB_WORKSPACE | |
# SUPER_SECRET: ${{ secrets.DOCS_API_TOKEN_GITHUB }} | |
# REPO: masesgroup/JCOReflector |