Export docs to public repo for docs #11
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: totally-not-rabbitmq | |
name: notRabbit | |
# Triggers the workflow on push or pull request events but only for the main branch | |
on: | |
push: | |
branches: [ feature/doc ] | |
pull_request: | |
branches: [ feature/doc ] | |
workflow_dispatch: | |
# A simple workflow to build a C++ project and generate documentation with hdoc | |
jobs: | |
build: | |
env: | |
BUILD_TYPE: 'Debug' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install dependencies, then configure and build project | |
run: | | |
sudo apt install build-essential cmake ninja-build | |
# cmake -GNinja -Bbuild -DCMAKE_EXPORT_COMPILE_COMMANDS=1 | |
# ninja -C build # Optional, you don't need to build the project to use hdoc | |
- name: Get Conan | |
uses: turtlebrowser/[email protected] | |
- name: Create default profile | |
run: conan profile detect --force | |
# - name: Update profile | |
# run: conan profile update settings.compiler.libcxx=libstdc++11 default | |
- name: Configure CMake | |
run: cmake -B ${{github.workspace}}/build -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES="conan_provider.cmake" -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | |
- name: Run hdoc to generate documentation and push it to docs.hdoc.io | |
uses: hdoc/hdoc-github-action@v2 | |
with: | |
compile-commands-path: build/compile_commands.json | |
hdoc-api-key: ${{ secrets.HDOC_PROJECT_API_KEY }} | |
- name: Set up Git credentials | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "GitHub Actions" | |
- name: Clone destination repository | |
run: | | |
git clone https://github.com/SUAI-getz-programmers/rabbit-docs.git | |
cd rabbit-docs | |
- name: Clean previous documentation files | |
run: | | |
find . -path ./.git -prune -o -exec rm -rf {} + | |
- name: Copy new documentation files | |
run: | | |
cp -r ../hdoc-output/* . | |
- name: Commit and push changes | |
run: | | |
git add . | |
git commit -m "[GHA] Update the documentation files." | |
git push origin main |