Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/pip/cryptography-42.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
swcurran authored Feb 23, 2024
2 parents bc48944 + 73dd7ed commit af6609c
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@ name: publish-docs

on:
push:
# Publish `main` as latest
# Publish `main` as latest, and when pushes are done to branches with "v-doc" prefix
branches:
- main

# Publish `v1.2.3` tags as releases
tags:
- v*
- docs-v*

permissions:
contents: write
Expand Down Expand Up @@ -39,14 +36,15 @@ jobs:
# Strip git ref prefix from version
echo "${{ github.ref }}"
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && ALIAS=$(echo $VERSION | sed -e 's/^v//')
# Strip "docs-v" prefix from branch name
[[ "$VERSION" == "docs-v"* ]] && ALIAS=$(echo $VERSION | sed -e 's/^docs-v//') && VERSION=${ALIAS}
# Copy all of the root level md files into the docs folder for deployment, tweaking the relative paths
for i in *.md; do sed -e "s#docs/#./#g" $i >docs/$i; done
# Populate overrides for the current version, and then remove to not apply if VERSION is main branch
echo -e "{% extends "base.html" %}\n\n{% block outdated %}\n You are viewing the documentation for ACA-Py Release $VERSION.\n{% endblock %}" >overrides/base.html
# If building from main, use latest as ALIAS
[ "$VERSION" == "main" ] && ALIAS=latest && rm overrides/base.html
OVERRIDE=overrides/main.html
echo -e "{% extends \"base.html\" %}\n\n{% block outdated %}\n You are viewing the documentation for ACA-Py Release $ALIAS.\n{% endblock %}" >$OVERRIDE
# If building from main, use latest as ALIAS and remove the override
[ "$VERSION" == "main" ] && ALIAS=latest && rm $OVERRIDE
echo $VERSION $ALIAS
mike deploy --push --update-aliases $VERSION $ALIAS
mike set-default latest

0 comments on commit af6609c

Please sign in to comment.