Skip to content

Commit

Permalink
Merge pull request #183 from gaiaresources/doc-ci-changes
Browse files Browse the repository at this point in the history
Documentation CI changes
  • Loading branch information
joecrowleygaia authored Aug 20, 2024
2 parents 97ddaee + 0c3be71 commit 1549307
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 54 deletions.
54 changes: 0 additions & 54 deletions .github/workflows/ci.yml

This file was deleted.

63 changes: 63 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Documentation
on:
release:
types:
- published
- deleted
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: write
jobs:
documentation:
env:
DOCS_BRANCH: docs-site
runs-on: ubuntu-latest
steps:
- name: Checkout ${{ env.DOCS_BRANCH }}
uses: actions/checkout@v4
with:
ref: ${{ env.DOCS_BRANCH }}
- uses: actions/checkout@v4
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Install Poetry
run: pipx install poetry==1.8.3
- uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: poetry
- name: Install project and dependencies
run: |
poetry install --sync
poetry env info
- name: Generate markdown
run: poetry run bash scripts/generate_instructions.sh

- name: Build and deploy dev documentation
if: ${{ github.event_name == 'push' }}
run: poetry run mike deploy --push --branch=${{ env.DOCS_BRANCH }} dev

- name: Build and deploy published tag documentation
if: ${{ github.event_name == 'release' && github.event.action == 'published' }}
run: |
echo "Creating documentation version ${{ github.ref_name }}"
poetry run mike deploy --push --branch=${{ env.DOCS_BRANCH }} --update-aliases ${{ github.ref_name }} latest
poetry run mike set-default --push --branch=${{ env.DOCS_BRANCH }} latest
- name: Remove deleted tag documentation
if: ${{ github.event_name == 'release' && github.event.action == 'deleted' }}
run: |
echo "Deleting documentation version ${{ github.ref_name }}"
poetry run mike delete --push --branch=${{ env.DOCS_BRANCH }} ${{ github.ref_name }}
- name: Build documentation for pull request
if: ${{ github.event_name == 'pull_request' }}
run: poetry run mkdocs build

0 comments on commit 1549307

Please sign in to comment.