Adding CPP CodeQL Scanning (#309) #31
This file contains hidden or 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: Update Docs | |
| on: | |
| push: | |
| branches: | |
| - develop | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: {} | |
| jobs: | |
| check_files: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| docs_changed: ${{ steps.check_changed_files.outputs.docs_changed }} | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.1.7 | |
| with: | |
| fetch-depth: 0 | |
| - id: check_changed_files | |
| run: | | |
| # Diff HEAD | |
| diff=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }}) | |
| # Check for changes in docs/ | |
| docs_changed=false | |
| for FILE in $diff; do | |
| if [[ "$FILE" == docs/* ]]; then | |
| docs_changed=true | |
| fi | |
| done | |
| # Set output | |
| echo "docs_changed=$docs_changed" >> $GITHUB_OUTPUT | |
| # Run job only if changes occurred in docs/ | |
| deploy: | |
| permissions: | |
| contents: write | |
| issues: write | |
| pull-requests: write | |
| runs-on: ubuntu-latest | |
| needs: [ check_files ] | |
| if: needs.check_files.outputs.docs_changed == 'true' | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.1.7 | |
| - name: Configure Git Credentials | |
| run: | | |
| git config user.name github-actions[bot] | |
| git config user.email 41898282+github-actions[bot]@users.noreply.github.com | |
| - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 | |
| with: | |
| python-version: 3.x | |
| - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV | |
| - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 | |
| with: | |
| key: mkdocs-${{ env.cache_id }} | |
| path: .cache | |
| restore-keys: | | |
| mkdocs- | |
| - run: pip install -r .github/doc-requirements.txt | |
| - run: mkdocs gh-deploy --force |