Skip to content

Docs for @blue.generic and Generic Class syntax (#527) #25

Docs for @blue.generic and Generic Class syntax (#527)

Docs for @blue.generic and Generic Class syntax (#527) #25

Workflow file for this run

name: Deploy to GitHub Pages
on:
push:
tags:
- 'v*.*.*'
branches:
- main
- 'docs/**'
paths:
- 'docs/**'
workflow_dispatch: # Allows manual triggering
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
pages: write
id-token: write
# Allow only one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
document-deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup SSH
uses: webfactory/ssh-agent@v0.8.0
with:
ssh-private-key: ${{ secrets.SPYLANG_DOCS_DEPLOY_KEY }}
- name: Clone docs repository
run: |
git clone ${{ vars.SPY_DOCS_REPOSITORY }} /tmp/spy-docs
- name: Determine version
id: version
run: |
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
# Tagged release
VERSION=${GITHUB_REF#refs/tags/v}
ALIAS="latest"
else
# Regular commit - deploy as "dev"
VERSION="dev"
ALIAS=""
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "alias=$ALIAS" >> $GITHUB_OUTPUT
echo "Deploying version: $VERSION from ${{ github.ref }}"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- name: Install dependencies
run: |
pip install .[docs]
- name: Configure Git in docs repository
working-directory: /tmp/spy-docs
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com"
- name: Build and deploy mkdocs
working-directory: /tmp/spy-docs
run: |
if [[ "${{ steps.version.outputs.alias }}" == "latest" ]]; then
# Tagged release - deploy with version and "latest" alias
mike deploy --config-file $GITHUB_WORKSPACE/docs/mkdocs.yml -b main --push --update-aliases ${{ steps.version.outputs.version }} latest
else
# Dev build - deploy/update "dev" version
mike deploy --config-file $GITHUB_WORKSPACE/docs/mkdocs.yml -b main --push --update-aliases dev
fi
# this makes the /dev version the default. Change it to /latest when we have stable releases!
mike set-default --config-file $GITHUB_WORKSPACE/docs/mkdocs.yml -b main --push dev