-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #183 from gaiaresources/doc-ci-changes
Documentation CI changes
- Loading branch information
Showing
2 changed files
with
63 additions
and
54 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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 |