Skip to content

Commit 98d6bbe

Browse files
committed
add gh actions for documentation deployment
1 parent 0bf7e21 commit 98d6bbe

4 files changed

Lines changed: 108 additions & 1 deletion

File tree

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Documentation Preview
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- closed
8+
- synchronize
9+
- reopened
10+
paths:
11+
- mkdocs.yml
12+
- docs/**
13+
- .github/workflows/documentation-pr-preview.yml
14+
15+
concurrency:
16+
group: gh-pages
17+
18+
jobs:
19+
deploy-preview:
20+
name: Preview documentation
21+
runs-on: ubuntu-latest
22+
23+
permissions:
24+
contents: write
25+
pull-requests: write
26+
27+
steps:
28+
- name: Checkout Repository
29+
uses: actions/checkout@v4
30+
with:
31+
fetch-depth: 0
32+
33+
- name: Create Documentation Preview
34+
uses: secure-software-engineering/actions/documentation/pr-preview@develop
35+
with:
36+
preview-name: pr-${{ github.event.pull_request.number }}
37+
preview-title: PR ${{ github.event.pull_request.number }} - ${{ github.event.pull_request.title }}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Deploy Documentation Snapshot
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
paths:
8+
- mkdocs.yml
9+
- docs/**
10+
- .github/workflows/documentation-snapshot.yml
11+
12+
concurrency:
13+
group: gh-pages
14+
15+
jobs:
16+
deploy-snapshot:
17+
name: Deploy documentation snapshot
18+
runs-on: ubuntu-latest
19+
20+
permissions:
21+
contents: write
22+
23+
steps:
24+
- name: Checkout Repository
25+
uses: actions/checkout@v4
26+
with:
27+
fetch-depth: 0
28+
29+
- name: Extract Maven Version
30+
id: version
31+
run: |
32+
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
33+
echo "version=$VERSION" >> $GITHUB_OUTPUT
34+
35+
- name: Deploy Snapshot Documentation
36+
uses: secure-software-engineering/actions/documentation/deployment@develop
37+
with:
38+
name: ${{ steps.version.outputs.version }}
39+
title: ${{ steps.version.outputs.version }}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Deploy Stable Documentation
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
concurrency:
9+
group: gh-pages
10+
11+
jobs:
12+
deploy-stable:
13+
name: Deploy stable documentation
14+
runs-on: ubuntu-latest
15+
16+
permissions:
17+
contents: write
18+
19+
steps:
20+
- name: Checkout Repository
21+
uses: actions/checkout@v4
22+
with:
23+
ref: ${{ github.ref }}
24+
fetch-depth: 0
25+
26+
- name: Deploy Stable Documentation
27+
uses: secure-software-engineering/actions/documentation/deployment@develop
28+
with:
29+
name: ${{ github.ref_name }}
30+
title: ${{ github.ref_name }}
31+
stable: true

mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use_directory_urls: false
88
# Repository info
99
repo_name: secure-software-engineering/CogniCryptSQPlugin
1010
repo_url: https://github.com/secure-software-engineering/CogniCryptSQPlugin
11-
edit_uri: edit/testing/docs/ # Change to main branch when needed!
11+
edit_uri: edit/main/docs/
1212

1313

1414
# Theme configuration

0 commit comments

Comments
 (0)