-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
17 additions
and
2 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 |
---|---|---|
|
@@ -64,14 +64,28 @@ jobs: | |
- run: git remote add doc [email protected]:patchlevel/event-sourcing-docs.git | ||
- run: git fetch doc gh-pages --verbose | ||
|
||
- run: | | ||
- run: | | ||
current_major=$(echo "$version_current" | cut -d '.' -f 1) | ||
current_minor=$(echo "$version_current" | cut -d '.' -f 2) | ||
latest_major=$(echo "$version_latest" | cut -d '.' -f 1) | ||
latest_minor=$(echo "$version_latest" | cut -d '.' -f 2) | ||
if [ "${{ steps.current.outputs.result }}" = "${{ steps.latest.outputs.result }}" ] | ||
then | ||
# Here we deploy a new latest version | ||
mike deploy ${{ steps.current.outputs.result }} latest --config-file docs/mkdocs.yml --update-aliases --push --remote doc | ||
mike deploy latest ${{ steps.current.outputs.result }} --config-file docs/mkdocs.yml --update-aliases --alias-type=redirect --push --remote doc | ||
mike retitle latest "${{ steps.current.outputs.result }} (latest)" --config-file docs/mkdocs.yml | ||
else | ||
# Here we deploy a version that's not the latest one | ||
mike deploy ${{ steps.current.outputs.result }} --config-file docs/mkdocs.yml --push --remote doc | ||
# If the current semver version is bigger than the latest one, we rename the title to dev | ||
if [ "$current_major" -gt "$latest_major" ] || \ | ||
{ [ "$current_major" -eq "$latest_major" ] && [ "$current_minor" -gt "$latest_minor" ]; } | ||
then | ||
mike retitle ${{ steps.current.outputs.result }} "${{ steps.current.outputs.result }} (dev)" --config-file docs/mkdocs.yml | ||
fi | ||
fi | ||
- 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