.github/workflows/update.yml #10926
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
| on: | |
| schedule: | |
| - cron: '17 * * * *' | |
| push: | |
| branches: | |
| - 'main' | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| update: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.x" | |
| - uses: astral-sh/setup-uv@v5 | |
| - uses: actions/checkout@v4 | |
| - run: sudo apt-get install -y gettext | |
| - run: pip install -r requirements.txt | |
| - run: uv run generate.py # generates index.html and index.json | |
| - name: Deploy π | |
| if: github.event_name != 'pull_request' | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| folder: build | |
| clean: false | |
| git-config-name: github-actions[bot] | |
| git-config-email: 41898282+github-actions[bot]@users.noreply.github.com | |
| - name: Deploy to subdirectory if pull request π | |
| # This does not work for PRs from forks | |
| if: github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| folder: build | |
| target-folder: ${{ github.ref_name }} | |
| clean: false | |
| git-config-name: github-actions[bot] | |
| git-config-email: 41898282+github-actions[bot]@users.noreply.github.com | |
| - name: Update PR description if pull request | |
| # This does not work for PRs from forks | |
| if: github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork | |
| uses: chabroA/[email protected] | |
| with: | |
| auth: ${{ secrets.GITHUB_TOKEN }} | |
| repo: ${{ github.event.repository.name }} | |
| owner: ${{ github.repository_owner }} | |
| pr: ${{ github.event.number }} | |
| url: "https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/${{ github.ref_name }}/" | |
| message: "π Dashboard preview π:" | |
| - name: Debug index.html if pull request | |
| if: github.event_name == 'pull_request' | |
| run: | | |
| curl -Lo index.html-public https://github.com/python-docs-translations/dashboard/raw/refs/heads/gh-pages/index.html | |
| diff --color=always -u index.html-public build/index.html || : | |
| cat build/index.html | |
| - run: uv run generate_build_details.py # generates build-details.html | |
| - name: Deploy build details view π | |
| if: github.event_name != 'pull_request' | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| folder: build | |
| clean: false | |
| git-config-name: github-actions[bot] | |
| git-config-email: 41898282+github-actions[bot]@users.noreply.github.com | |
| - name: Deploy metadata view to subdirectory if pull request π | |
| if: github.event_name == 'pull_request' | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| folder: build | |
| target-folder: ${{ github.ref_name }} | |
| clean: false | |
| git-config-name: github-actions[bot] | |
| git-config-email: 41898282+github-actions[bot]@users.noreply.github.com | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: build | |
| path: build |