action to build tag docs #27
Workflow file for this 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
name: Generate Docs for Release Tag | |
on: | |
push: # TODO remove this | |
branches: [ action-for-release-tag-docs ] | |
release: | |
types: [created] | |
workflow_dispatch: | |
inputs: | |
tag-name: | |
description: 'The tag name to build docs for' | |
required: false # Allow empty for cases where the release event provides the tag | |
default: '' | |
jobs: | |
build-docs-for-tag: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.8' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r docs/requirements.txt | |
pip install runhouse sshtunnel python-dotenv gitpython | |
- name: Determine Tag Name | |
id: determine-tag | |
run: | | |
if [[ "${{ github.event_name }}" == "release" ]]; then | |
echo "Tag name from release: ${{ github.event.release.tag_name }}" | |
echo "tag_name=${{ github.event.release.tag_name }}" >> $GITHUB_ENV | |
elif [[ -n "${{ github.event.inputs.tag-name }}" ]]; then | |
echo "Tag name from manual input: ${{ github.event.inputs.tag-name }}" | |
echo "tag_name=${{ github.event.inputs.tag-name }}" >> $GITHUB_ENV | |
else | |
echo "Tag name from manual input: v0.0.20" | |
echo "tag_name=v0.0.20" >> $GITHUB_ENV | |
fi | |
shell: bash | |
- name: Run docs build script for specific tag | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
TAG_NAME: ${{ env.tag_name }} | |
run: | | |
python scripts/generating_docs.py --tag-name "${{ env.TAG_NAME }}" | |
# echo "Error: No tag name provided" | |
# exit 1 |