chore: remove triggered twice on PR #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: Build and Deploy for Release and Documentation | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install CMake, Doxygen, and Graphviz | |
run: sudo apt-get update && sudo apt-get install -y cmake doxygen graphviz | |
# We need to add these manually to make the opencv action below work | |
- name: Add Missing APT Keys | |
run: | | |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5 | |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32 | |
sudo apt-get update | |
- name: Setup opencv | |
uses: Dovyski/[email protected] | |
with: | |
opencv-version: '4.9.0' | |
opencv-extra-modules: false | |
install-deps: false | |
- name: Configure the Project for Release | |
run: | | |
cmake -DCMAKE_BUILD_TYPE:STRING=Release \ | |
-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE \ | |
-DCMAKE_C_COMPILER:FILEPATH=/usr/bin/gcc \ | |
-DCMAKE_CXX_COMPILER:FILEPATH=/usr/bin/g++ \ | |
-S ${{ github.workspace }} \ | |
-B ${{ github.workspace }}/build \ | |
-G "Unix Makefiles" | |
- name: Build the Project | |
run: | | |
cmake --build ${{ github.workspace }}/build --config Release --target all -j 2 | |
# Add tests after build | |
# Also add more steps for publishing release / docker push | |
- name: Generate Documentation | |
run: doxygen Doxyfile | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
if: github.event_name == 'push' | |
with: | |
personal_token: ${{ secrets.DOCUMENTATION_PAT }} | |
external_repository: imb410/TrafficEZ-Documentation | |
publish_branch: gh-pages | |
publish_dir: ./doc/html | |
allow_empty_commit: true | |
keep_files: false | |