release 2.6.1 #48
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
name: Publish docs on GitHub Pages | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
name: Deploy docs | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout main | |
uses: actions/checkout@v3 | |
- name: Get current app version | |
id: vars | |
run: | | |
echo ::set-output name=version::$(grep "__version__ =" Squest/version.py |awk '{printf $3}' | sed -e 's/^"//' -e 's/"$//') | |
- name: Print app version | |
run: | | |
echo ${{ steps.vars.outputs.version }} | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install mkdocs==1.6.0 mkdocs-material==9.5.22 mike==2.1.1 | |
- name: Get current branch name | |
shell: bash | |
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" | |
id: extract_branch | |
- name: Publish last version | |
run: | | |
set -e | |
if ! git config --get user.name; then | |
git config --global user.name "${GITHUB_ACTOR}" | |
fi | |
if ! git config --get user.email; then | |
git config --global user.email "${GITHUB_ACTOR}@users.noreply.${GITHUB_DOMAIN:-"github.com"}" | |
fi | |
remote_repo="https://x-access-token:${GITHUB_TOKEN}@${GITHUB_DOMAIN:-"github.com"}/${GITHUB_REPOSITORY}.git" | |
git remote rm origin | |
git remote add origin "${remote_repo}" | |
git checkout --orphan gh-pages | |
git pull origin gh-pages | |
git checkout ${{ steps.extract_branch.outputs.branch }} | |
mike deploy --push --update-aliases ${{ steps.vars.outputs.version }} latest --alias-type=redirect |