Skip to content

fix: correct workflow structure, make deploy depend on check #2

fix: correct workflow structure, make deploy depend on check

fix: correct workflow structure, make deploy depend on check #2

Workflow file for this run

name: Check and deploy knowledgebase

Check failure on line 1 in .github/workflows/docs.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/docs.yml

Invalid workflow file

(Line: 25, Col: 13): Unexpected symbol: '"main"'. Located at position 20 within expression: github.ref_name == "main"
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