-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add automated publishing of diagrams to GitHub Pages
- Loading branch information
1 parent
1bab39e
commit 6afcf41
Showing
2 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/sh | ||
|
||
repository_name=$(git rev-parse --show-toplevel | xargs basename) | ||
|
||
echo "Clone $repository_name..." | ||
git clone https://github.com/calypsonet/$repository_name.git | ||
|
||
cd "$repository_name" || exit | ||
|
||
echo "Repository name: $repository_name" | ||
|
||
echo "Checkout gh-pages branch..." | ||
git checkout -f gh-pages | ||
|
||
echo "Delete existing SNAPSHOT directory..." | ||
rm -rf *-SNAPSHOT | ||
|
||
echo "Copy diagram folders..." | ||
find .. -type d -regex '\.\./[0-9].*$' -exec cp -rf -t . {} + | ||
|
||
echo "Update versions list..." | ||
echo "| Version | Documents |" > list_versions.md | ||
echo "|:---:|---|" >> list_versions.md | ||
for directory in $(ls -rd [0-9]*/ | cut -f1 -d'/') | ||
do | ||
line="| $directory |" | ||
cd "$directory" || exit | ||
for file in $(ls -r *.svg | cut -f1 -d'/') | ||
do | ||
line="$line[$file]($directory/$file)<br/>" | ||
done | ||
line="$line|" | ||
cd .. | ||
echo "$line" >> ./list_versions.md | ||
done | ||
|
||
echo "Local docs update finished." | ||
|
||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Publish Calypsonet Terminal Calypso Crypto Legacy SAM Java API - UML class diagrams to GH pages | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
publish-diagrams: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository code from ${{ github.repository }}/${{ github.ref }} | ||
uses: actions/checkout@v3 | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '11' | ||
distribution: 'adopt' | ||
- name: Update permissions | ||
working-directory: . | ||
run: chmod +x ./.github/scripts/*.sh | ||
- name: Prepare publication locally | ||
working-directory: . | ||
run: ./.github/scripts/prepare_publication.sh | ||
- name: Deploy diagrams to gh-pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./${{ github.event.repository.name }} | ||
enable_jekyll: true |