Skip to content

publish docs CI

publish docs CI #57

Workflow file for this run

name: publish docs CI
on:
workflow_dispatch:
inputs:
version:
required: false
description: 'Version number from branch / "main" for latest'
# default: "main"
type: string
alias:
required: false
description: 'Version alias / "latest" for latest'
# default: "latest"
type: string
title:
required: false
description: 'Doc site dropdown menu title (version +/- latest)'
# default: "latest"
type: string
latest:
required: false
description: 'Mark version version as latest'
type: string
# pull_request:
# branches:
# - "main"
jobs:
install_dependencies_and_deploy:
name: install dependencies and deploy latest changes to prod
runs-on: ubuntu-latest
steps:
- name: checkout latest
uses: actions/checkout@v3
with:
ref: ${{ inputs.version }}
fetch-depth: 0
- name: setup python
uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: 'pip' # caching pip dependencies
- name: install dependencies
run: |
pip3 install -r requirements.txt
- name: Configure Git User
run: |
git config user.name "circleci-runai"
git config user.email "[email protected]"
# git fetch origin gh-pages --depth=1
# - name: deploy mkdocs latest
# run: mkdocs gh-deploy --force
# echo "deploy new version with mike..."
# if: ${{ inputs.version == 'main'}}
# run: |
# mike deploy --push ${{ inputs.version }} ${{ inputs.alias }} --title=${{ inputs.title }}-latest
# mike set-default ${{ inputs.alias }} --ignore
# - name: deploy mkdocs version
# if: ${{ inputs.version != 'main' }}
# run: |
# mike deploy --push ${{ inputs.version }} ${{ inputs.alias }} --title=${{ inputs.title }}-latest
# mike set-default ${{ inputs.alias }} --ignore
# if [[ "${{ inputs.delete_latest }}" == 'true' ]]; then
# mike delete --push latest
# fi
# --title=${{ inputs.alias }}${latest}
# run: mike delete --push 2.9a
# THIS IS GOOD CODE!!!
# mike list
# echo "deploy new version with mike..."
# latest=""
# if [[ "${{ inputs.version }}" == 'main' ]]; then
# version=latest
# latest="-latest"
# else
# version=${{ inputs.version }}
# fi
# echo "${version}"
# mike deploy --push ${{ inputs.version }} ${{ inputs.alias }} --title=${{ inputs.title }}
# if [[ "${{ inputs.version }}" == 'main' ]]; then
# echo "setting this version as a latest..."
# mike set-default ${{ inputs.alias }} --ignore
# fi
- name: deploy latest mkdocs
if: ${{ inputs.latest == 'latest'}}
run: |
git fetch origin gh-pages --depth=1
mike deploy --push ${{ inputs.version }} ${{ inputs.latest }} --title=${{ inputs.title }}
mike set-default --push latest
mike list
- name: deploy a version of mkdocs
if: ${{ inputs.latest != 'latest'}}
run: |
git fetch origin gh-pages --depth=1
mike deploy --push ${{ inputs.version }} ${{ inputs.alias }} --title=${{ inputs.title }}
mike list
# - name: latest version
# if: ${{ inputs.latest == 'latest' }}
# run: |
# mike deploy --push --update-aliases ${{ inputs.alias }} latest
# mike list