Skip to content

Merge pull request #182 from vintasoftware/release/0.1.0 #67

Merge pull request #182 from vintasoftware/release/0.1.0

Merge pull request #182 from vintasoftware/release/0.1.0 #67

Workflow file for this run

name: Publish Documentation
on:
push:
branches:
- main
- docs-update
tags:
- "**"
env:
COLUMNS: 150
jobs:
publish:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: checkout gh-pages
uses: actions/checkout@v4
with:
ref: gh-pages
fetch-depth: 0
- name: checkout current branch
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install
- name: Check docs build
run: |
poetry run mkdocs build
- name: Run tests
run: |
poetry run pytest
env:
OPENAI_API_KEY: "sk-fake-test-key-123"
- name: Set git credentials
run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
- name: Deploy on push to main
if: ${{ github.ref == 'refs/heads/main' }}
run: |
poetry run mike deploy -b gh-pages dev --push
- name: Extract package version
if: ${{ github.ref == 'refs/heads/docs-update' || startsWith(github.ref, 'refs/tags/') }}
run: |
echo "VERSION=$(poetry version -s)" >> $GITHUB_ENV
- name: Deploy on push to docs-update branch or tag push
if: ${{ (github.ref == 'refs/heads/docs-update' || startsWith(github.ref, 'refs/tags/')) && !fromJSON(steps.check-version.outputs.IS_PRERELEASE) }}
run: |
poetry run mike deploy -b gh-pages ${{ env.VERSION }} latest --update-aliases --push