Skip to content

Merge pull request #1492 from DependencyTrack/docs-more-space #61

Merge pull request #1492 from DependencyTrack/docs-more-space

Merge pull request #1492 from DependencyTrack/docs-more-space #61

Workflow file for this run

# This file is part of Dependency-Track.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) OWASP Foundation. All Rights Reserved.
name: Deploy Documentation
on:
push:
paths:
- "docs/**"
- mkdocs.yml
branches:
- main
release:
types:
- released
permissions: { }
jobs:
deploy-docs:
name: Deploy Documentation
runs-on: ubuntu-latest
permissions:
contents: write # Required to create releases
steps:
- name: Checkout Repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag=v4.1.7
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # tag=v5.2.0
with:
python-version: "3.9"
check-latest: true
- name: Install Requirements
run: |-
pip install 'mkdocs-material[imaging]' mike
- name: Determine Project Version
id: determine_version
run: |-
VERSION="$(yq -p=xml -o=xml '.project.version' pom.xml)"
ALIASES=""
if [[ $VERSION == *-SNAPSHOT ]]; then
ALIASES="snapshot"
else
ALIASES="latest"
fi
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "aliases=${ALIASES}" >> $GITHUB_OUTPUT
- name: Configure Git User
run: |-
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Deploy
env:
VERSION: "${{ steps.determine_version.outputs.version }}"
ALIASES: "${{ steps.determine_version.outputs.aliases }}"
run: mike deploy --push --update-aliases $VERSION ${ALIASES[*]}