name: Build pages and publish on: push permissions: contents: read jobs: build: runs-on: ubuntu-latest permissions: contents: write # required to push to the gh-pages branch steps: - uses: actions/checkout@v4 with: fetch-depth: 0 # full history - used for the "last modified" date of plugins - uses: actions/setup-python@v5 with: python-version: '3.12' cache: pip - run: pip install -r requirements.txt - name: Build site # strict mode (set in mkdocs.yml) fails the build on broken internal links run: zensical build --clean - name: Generate plugins.json and legacy feeds run: python scripts/post_build.py - name: Deploy if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main'}} uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_branch: 'gh-pages' publish_dir: ./site