Skip to content

Commit

Permalink
Update documentation generation workflow
Browse files Browse the repository at this point in the history
The workflow was assuming a 'dist' directory would be present from
the mkdocs yaml configuration; but this is not always the case.
Rather than assume, this now uses `yq` to parse the value instead.
  • Loading branch information
bitwizeshift committed Jun 16, 2024
1 parent bc63e1f commit 85abbc4
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions .github/workflows/deploy-github-pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ permissions:
id-token: write

jobs:
docs:
generate-documentation:
name: Generate Documentation
runs-on: ubuntu-latest
steps:
Expand All @@ -22,6 +22,12 @@ jobs:
with:
python-version: "3.10"

- name: Read metadata
id: metadata
run: |
site_dir=$(yq '.site_dir // "dist"' mkdocs.yaml)
echo "site-dir=${site_dir}" >> "${GITHUB_OUTPUT}"
- name: Install dependencies
run: |
pip install mkdocs
Expand All @@ -37,18 +43,19 @@ jobs:
# this.
- name: Fix permissions
run: |
find ./dist -type d -exec chmod 0755 {} \;
find ./dist -type f -name '.lock' -delete
site_dir="${{ steps.metadata.outputs.site_dir }}"
find "./${site_dir}" -type d -exec chmod 0755 {} \;
find "./${site_dir}" -type f -name '.lock' -delete
- name: Upload Pages Artifact
uses: actions/upload-pages-artifact@v3
with:
path: dist/
path: ${{ steps.metadata.outputs.site_dir }}/

deploy:
name: Deploy to GH Pages
runs-on: ubuntu-latest
needs: docs
needs: generate-documentation

permissions:
contents: read
Expand Down

0 comments on commit 85abbc4

Please sign in to comment.