Skip to content

Merge pull request #234 from RealEstateCore/dev/cbupp/controllers-and… #28

Merge pull request #234 from RealEstateCore/dev/cbupp/controllers-and…

Merge pull request #234 from RealEstateCore/dev/cbupp/controllers-and… #28

name: Merge and Generate
on:
workflow_dispatch:
push:
branches:
- "main"
paths:
- "Source/DTDL**"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
token: ${{ secrets.CI_PUSH_PAT }}
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Build DTDL Merger
run: dotnet build ./Tools/DTDLMerger/
- name: Run DTDL Merger on REC DTDLv2
run: dotnet run --project ./Tools/DTDLMerger/ ./Source/DTDLv2/ > ./RealEstateCore.DTDLv2.jsonld
- name: Increment .nuspec revision number
id: increment
uses: vers-one/[email protected]
with:
files: "Metadata/*.nuspec"
version: bump-revision
- name: Build DTDL2MD
run: dotnet build ./Tools/DTDL2MD/
- name: Delete old docs
run: |
mv Doc/index.md ./DocIndexBackup.md
rm -rf Doc/*
mv DocIndexBackup.md ./Doc/index.md
- name: Run DTDL2MD to generate docs
run: dotnet run --project ./Tools/DTDL2MD/ -i ./RealEstateCore.DTDLv2.jsonld -o ./Doc/
- name: Build DTDL2OAS
run: dotnet build ./Tools/DTDL2OAS/
- name: Run DTDL2OAS to generate API specification
run: dotnet run --project ./Tools/DTDL2OAS --inputPath ./Source/DTDLv2/ --nuspecPath ./Metadata/RealEstateCore.Ontology.DTDLv2.nuspec --endpointsPath ./API/REST/Endpoints.csv --outputPath ./API/REST
- name: 'Commit merged and documented output'
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Merged and regenerated docs/APIs for revision ${{ steps.increment.outputs.newVersion }}
- name: 'Checkout dev site'
uses: actions/checkout@v3
with:
repository: RealEstateCore/realestatecore.github.io
path: realestatecore.github.io
token: ${{ secrets.CI_PUSH_PAT }}
- name: 'Delete old docs from dev site'
run: rm -rf ./realestatecore.github.io/ontology/*
- name: 'Copy new docs to dev site'
run: cp -r ./Doc/* ./realestatecore.github.io/ontology/
- name: 'Commit and push updated docs'
run: |
cd ./realestatecore.github.io/ontology/
git config --global user.email "[email protected]"
git config --global user.name "github-actions[bot]"
git add .
git commit -a -m "Updated docs to version ${{ steps.increment.outputs.newVersion }}"
git push