diff --git a/.github/workflows/documentation-pr-preview.yml b/.github/workflows/documentation-pr-preview.yml new file mode 100644 index 0000000..ecc40ce --- /dev/null +++ b/.github/workflows/documentation-pr-preview.yml @@ -0,0 +1,36 @@ +name: Documentation Preview + +on: + pull_request: + types: + - opened + - closed + - synchronize + - reopened + paths: + - mkdocs.yml + - docs/** + - .github/workflows/documentation-pr-preview.yml + +concurrency: + group: gh-pages + +jobs: + deploy-preview: + name: Preview documentation + runs-on: ubuntu-latest + + permissions: + contents: write + pull-requests: write + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Create Documentation Preview + uses: secure-software-engineering/actions/documentation/pr-preview@develop + with: + title: PR ${{ github.event.pull_request.number }} - ${{ github.event.pull_request.title }} \ No newline at end of file diff --git a/.github/workflows/documentation-snapshot.yml b/.github/workflows/documentation-snapshot.yml new file mode 100644 index 0000000..df65f30 --- /dev/null +++ b/.github/workflows/documentation-snapshot.yml @@ -0,0 +1,39 @@ +name: Deploy Documentation Snapshot + +on: + push: + branches: + - develop + paths: + - mkdocs.yml + - docs/** + - .github/workflows/documentation-snapshot.yml + +concurrency: + group: gh-pages + +jobs: + deploy-snapshot: + name: Deploy documentation snapshot + runs-on: ubuntu-latest + + permissions: + contents: write + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Extract Maven Version + id: version + run: | + VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) + echo "version=$VERSION" >> $GITHUB_OUTPUT + + - name: Deploy Snapshot Documentation + uses: secure-software-engineering/actions/documentation/deployment@develop + with: + name: ${{ steps.version.outputs.version }} + title: ${{ steps.version.outputs.version }} diff --git a/.github/workflows/documentation-stable.yml b/.github/workflows/documentation-stable.yml new file mode 100644 index 0000000..80733de --- /dev/null +++ b/.github/workflows/documentation-stable.yml @@ -0,0 +1,31 @@ +name: Deploy Stable Documentation + +on: + push: + tags: + - '*' + +concurrency: + group: gh-pages + +jobs: + deploy-stable: + name: Deploy stable documentation + runs-on: ubuntu-latest + + permissions: + contents: write + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + with: + ref: ${{ github.ref }} + fetch-depth: 0 + + - name: Deploy Stable Documentation + uses: secure-software-engineering/actions/documentation/deployment@develop + with: + name: ${{ github.ref_name }} + title: ${{ github.ref_name }} + stable: true diff --git a/mkdocs.yml b/mkdocs.yml index 6f5ca54..16dda43 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -8,7 +8,7 @@ use_directory_urls: false # Repository info repo_name: secure-software-engineering/CogniCryptSQPlugin repo_url: https://github.com/secure-software-engineering/CogniCryptSQPlugin -edit_uri: edit/testing/docs/ # Change to main branch when needed! +edit_uri: edit/main/docs/ # Theme configuration