Add documentation preview workflow (#41) #194
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: Build and Deploy to GitHub Pages | |
| on: | |
| schedule: | |
| - cron: '0 2 * * *' | |
| push: | |
| branches: | |
| - 3.14 | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Python repository | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: python/cpython | |
| ref: v3.14.6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.12' | |
| - name: Setup virtual environment | |
| run: make venv | |
| working-directory: ./Doc | |
| - name: Checkout translation files | |
| uses: actions/checkout@v4 | |
| with: | |
| path: Doc/locales/fa/LC_MESSAGES | |
| - name: Install gettext | |
| run: sudo apt-get install -y gettext | |
| - name: Compile .po files to .mo | |
| run: | | |
| find Doc/locales/fa/LC_MESSAGES -name "*.po" | while read f; do | |
| msgfmt "$f" -o "${f%.po}.mo" | |
| done | |
| - name: Setup problem matcher | |
| uses: sphinx-doc/github-problem-matcher@v1.1 | |
| - name: Build documentation | |
| run: make -e SPHINXOPTS="--color -D language='fa' -D gettext_allow_fuzzy_translations=1 --keep-going" html | |
| working-directory: ./Doc | |
| - name: Deploy to gh-pages | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: Doc/build/html | |
| keep_files: true | |
| enable_jekyll: false |