Fixing doc links. #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: [ master ] | |
| workflow_dispatch: # Allow manual triggering | |
| jobs: | |
| docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Install mkdocs and dependencies | |
| run: | | |
| pip install mkdocs-material | |
| - name: Build documentation | |
| run: mkdocs build --strict | |
| - name: Create root redirect | |
| run: | | |
| mkdir -p ./root | |
| cat > ./root/index.html << 'EOF' | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta http-equiv="refresh" content="0; url=/4.x/"> | |
| <link rel="canonical" href="https://ruby-rice.github.io/4.x/"> | |
| </head> | |
| <body> | |
| <p>Redirecting to <a href="/4.x/">documentation</a>...</p> | |
| </body> | |
| </html> | |
| EOF | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| deploy_key: ${{ secrets.DOCS_DEPLOY_KEY }} | |
| external_repository: ruby-rice/ruby-rice.github.io | |
| publish_branch: main | |
| publish_dir: ./site | |
| destination_dir: 4.x | |
| - name: Deploy root redirect | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| deploy_key: ${{ secrets.DOCS_DEPLOY_KEY }} | |
| external_repository: ruby-rice/ruby-rice.github.io | |
| publish_branch: main | |
| publish_dir: ./root | |
| keep_files: true |