Add requirements for Control Interface authorization #2022
Workflow file for this run
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: Documentation | |
on: | |
push: | |
branches: | |
- main | |
- release-** | |
pull_request: | |
workflow_dispatch: | |
workflow_call: | |
permissions: | |
contents: write | |
concurrency: | |
group: "documentation-${{ github.head_ref || github.ref }}" | |
cancel-in-progress: true | |
jobs: | |
documentation_changes: | |
name: Check if documentation has changed | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: read | |
outputs: | |
documentation: ${{ steps.filter.outputs.documentation }} | |
steps: | |
- uses: actions/checkout@v4.1.1 | |
- uses: dorny/paths-filter@v3.0.0 | |
id: filter | |
with: | |
filters: | | |
documentation: | |
- 'doc/**' | |
- 'api/proto/**' | |
- '.github/workflows/documentation.yml' | |
deploy: | |
name: Deploy documentation | |
needs: documentation_changes | |
if: ${{ needs.documentation_changes.outputs.documentation == 'true' || github.ref_name == 'main' || github.ref_type == 'tag' }} | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/eclipse-ankaios/devcontainer-base:0.10.2 | |
steps: | |
- uses: actions/checkout@v4.1.1 | |
- name: Prepare commit to branch gh-pages | |
run: | | |
git config --global --add safe.directory $PWD | |
git config user.name ci-bot | |
git config user.email ci-bot@example.com | |
git fetch origin gh-pages --depth=1 | |
- name: Generate documentation and deploy (push on main) | |
# execute only on push to main branch or when called by another workflow | |
if: ${{ (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref_name == 'main' }} | |
run: | | |
tools/generate_docs.sh deploy | |
- name: Generate documentation and deploy (for release) | |
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }} | |
run: | | |
# Convert tag to documentation version like v0.1.0 to 0.1 | |
DOCVER=$(expr match ${{ github.ref_name }} 'v\([0-9]\+\.[0-9]\+\)\.') | |
tools/generate_docs.sh deploy-release "$DOCVER" | |
- name: Generate documentation (for pull requests and release branches) | |
if: ${{ github.event_name == 'pull_request' || startsWith(github.ref_name, 'release-') }} | |
run: | | |
tools/generate_docs.sh build | |
lint: | |
name: Lint documentation | |
# No dependencies as we have markdown files in a lot of places | |
runs-on: ubuntu-latest | |
steps: | |
- name: git checkout | |
uses: actions/checkout@v4.1.1 | |
with: | |
show-progress: '' | |
- name: markdownlint-cli2-action | |
uses: DavidAnson/markdownlint-cli2-action@v15.0.0 | |
with: | |
globs: | | |
**/*.md | |
!.github/PULL_REQUEST_TEMPLATE.md |