Skip to content

Commit afb84e4

Browse files
Update Workflow to do Internal Deployment
Signed-off-by: Miles Price <[email protected]>
1 parent 11d40a4 commit afb84e4

File tree

1 file changed

+54
-21
lines changed

1 file changed

+54
-21
lines changed

.github/workflows/codeql.yml

Lines changed: 54 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,16 @@
1-
# For most projects, this workflow file will not need changing; you simply need
2-
# to commit it to your repository.
3-
#
4-
# You may wish to alter this file to override the set of languages analyzed,
5-
# or to provide custom queries or build logic.
6-
#
7-
# ******** NOTE ********
8-
# We have attempted to detect the languages in your repository. Please check
9-
# the `language` matrix defined below to confirm you have the correct set of
10-
# supported CodeQL languages.
11-
#
121
name: "CodeQL"
132

143
on:
154
push:
16-
branches: [ "main", "release_v*" ]
5+
branches: [ "main", "release_v*", "dev/milesp/doc-site-from-branch" ]
176
pull_request:
187
branches: [ "main", "release_v*" ]
198
schedule:
209
- cron: '28 22 * * 1'
2110

11+
env:
12+
deploy_docs_site: false
13+
2214
jobs:
2315
analyze:
2416
name: Analyze
@@ -36,7 +28,7 @@ jobs:
3628

3729
steps:
3830
- name: Checkout repository
39-
uses: actions/checkout@v3
31+
uses: actions/checkout@v4
4032
with:
4133
lfs: true
4234
submodules: 'recursive'
@@ -46,17 +38,19 @@ jobs:
4638
run: |
4739
sudo apt update -y && sudo apt install -y --no-install-recommends \
4840
git git-lfs gcc-11 g++-11 ninja-build ccache libgtest-dev libgmock-dev \
49-
shellcheck curl doxygen python3 python3-pip python3-dev python3-distutils
41+
shellcheck curl doxygen python3 python3-pip python3-dev python3-distutils cmake
5042
5143
- if: matrix.language == 'c-cpp'
5244
name: Install Python Dependencies
5345
run: |
54-
python3 -m pip install sphinx-rtd-theme sphinx==4.5.0 breathe exhale \
55-
recommonmark graphviz numpy==1.24.1
46+
sudo apt update -y && sudo apt install -y --no-install-recommends \
47+
python3 python3-pip python3-dev python3-distutils doxygen && sudo rm -rf /var/lib/apt/lists/* \
48+
&& python3 -m pip install sphinx-rtd-theme sphinx==4.5.0 breathe exhale recommonmark graphviz \
49+
&& python3 -m pip install numpy==1.24.1 patchelf==0.17.2.1
5650
5751
- if: matrix.language == 'c-cpp'
5852
name: Install CUDA Toolkit
59-
uses: Jimver/[email protected].11
53+
uses: Jimver/[email protected].15
6054
id: cuda-toolkit
6155
with:
6256
cuda: '11.7.1'
@@ -72,22 +66,61 @@ jobs:
7266
nvcc -V
7367
7468
- name: Initialize CodeQL
75-
uses: github/codeql-action/init@v2
69+
uses: github/codeql-action/init@v3
7670
with:
7771
languages: ${{ matrix.language }}
7872
queries: +security-and-quality
7973

8074
- if: matrix.language != 'c-cpp'
8175
name: Autobuild
82-
uses: github/codeql-action/autobuild@v2
76+
uses: github/codeql-action/autobuild@v3
8377

8478
- if: matrix.language == 'c-cpp'
8579
name: Build CMake project
8680
run: |
8781
echo "Running CMake project build script"
88-
./ci/build.sh debug build "-DBUILD_SAMPLES=OFF -DBUILD_TESTS=OFF" $*
82+
./ci/build.sh debug build "-DBUILD_SAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_DOCS=ON -DBUILD_PYTHON=ON" $*
8983
9084
- name: Perform CodeQL Analysis
91-
uses: github/codeql-action/analyze@v2
85+
uses: github/codeql-action/analyze@v3
9286
with:
9387
category: "/language:${{matrix.language}}"
88+
89+
- if: github.ref == 'refs/heads/main'
90+
name: Check for Changes in main
91+
id: check_main_changed
92+
run: |
93+
git fetch origin main
94+
if [[ $(git rev-list -n 1 HEAD) == $(git rev-list -n 1 origin/main) ]]; then
95+
echo "No changes in main"
96+
echo "deploy_docs_site=false" >> $GITHUB_ENV
97+
else
98+
echo "Changes detected in main"
99+
echo "deploy_docs_site=true" >> $GITHUB_ENV
100+
- if: github.ref == 'refs/heads/main'
101+
name: Export Main Changed Status
102+
run: |
103+
echo "Main changed status: $deploy_docs_site"
104+
env:
105+
deploy_docs_site: ${{ steps.check_main_changed.outputs.deploy_docs_site }}
106+
107+
- if: github.ref == 'refs/heads/main' && matrix.language == 'c-cpp' && env.deploy_docs_site == 'true'
108+
name: Clean up Sphinx Build Directory
109+
run: |
110+
find build/docs/sphinx -name '*.doctree' -delete
111+
find build/docs/sphinx -name '*.map' -delete
112+
find build/docs/sphinx -name '*.pickle' -delete
113+
find build/docs/sphinx -name '*.inv' -delete
114+
find build/docs/sphinx -name '*.gz' -delete
115+
116+
- if: github.ref == 'refs/heads/main' && matrix.language == 'c-cpp' && env.deploy_docs_site == 'true'
117+
name: Create .nojekyll file
118+
run: touch build/docs/sphinx/.nojekyll
119+
120+
- if: github.ref == 'refs/heads/main' && matrix.language == 'c-cpp' && env.deploy_docs_site == 'true'
121+
name: Deploy to GitHub Pages
122+
uses: JamesIves/github-pages-deploy-action@v4
123+
with:
124+
folder: build/docs/sphinx
125+
branch: gh-pages
126+
clean: true

0 commit comments

Comments
 (0)