fix github docs workflow (#1016) #2
This file contains hidden or 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: Deploy Documentation | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'docs/**' | |
| - 'mkdocs.yml' | |
| - 'README.md' | |
| - 'CONTRIBUTING.md' | |
| - 'CHANGELOG.md' | |
| - 'src/lambdas/api/openapi.yaml' | |
| - '.github/workflows/docs.yml' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write # Needed to push to gh-pages branch | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Fetch all history for git revision dates | |
| - name: Create symlinks for root docs | |
| run: | | |
| ln -sf ../../CHANGELOG.md docs/about/changelog.md | |
| ln -sf ../../LICENSE docs/about/license.md | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install Node dependencies | |
| run: npm ci | |
| - name: Build OpenAPI documentation | |
| run: npm run build-api-docs | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Install MkDocs dependencies | |
| run: pip install -r requirements-docs.txt | |
| - name: Configure Git for MkDocs | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git fetch --depth=1 origin gh-pages || true | |
| - name: Get version from package.json | |
| id: package-version | |
| run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT | |
| - name: Deploy documentation with mike | |
| run: | | |
| mike deploy --push --update-aliases ${{ steps.package-version.outputs.version }} latest | |
| mike set-default --push latest |