fix: correct workflow structure, make deploy depend on check #2
Workflow file for this run
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: Check and deploy knowledgebase | ||
| on: | ||
| push: | ||
| paths: | ||
| - 'docs/**' | ||
| - '.github/workflows/docs.yml' | ||
| - 'mkdocs.yml' | ||
| permissions: | ||
| contents: read | ||
| pages: write | ||
| id-token: write | ||
| concurrency: | ||
| group: "pages" | ||
| cancel-in-progress: false | ||
| jobs: | ||
| linkcheck: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@master | ||
| - uses: byrnereese/github-action-mkdocs-link-check@v1 | ||
| deploy: | ||
| if: github.ref_name == "main" | ||
| needs: linkcheck | ||
| runs-on: ubuntu-latest | ||
| environment: | ||
| name: github-pages | ||
| url: ${{ steps.deployment.outputs.page_url }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: '3.x' | ||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install mkdocs mkdocs-material mkdocs-static-i18n[material] | ||
| - name: Setup Pages | ||
| uses: actions/configure-pages@v5 | ||
| - name: Build | ||
| run: mkdocs build | ||
| - name: Upload artifact | ||
| uses: actions/upload-pages-artifact@v3 | ||
| with: | ||
| path: './site' | ||
| - name: Deploy to GitHub Pages | ||
| id: deployment | ||
| uses: actions/deploy-pages@v4 | ||