Update Index #843
This file contains 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: Update Index | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "34 * * * *" | |
jobs: | |
update_index: | |
permissions: | |
contents: write | |
id-token: write | |
pages: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: fetch pages | |
uses: actions/checkout@v4 | |
with: | |
ref: pages | |
path: pages | |
- name: checkout main | |
uses: actions/checkout@v4 | |
with: | |
path: main | |
- name: setup python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
- name: Install hatch | |
run: python -m pip install hatch | |
- id: auth | |
uses: google-github-actions/auth@v2 | |
with: | |
workload_identity_provider: projects/65154078780/locations/global/workloadIdentityPools/github/providers/py-wtf | |
service_account: [email protected] | |
project_id: pypinfo-214114 | |
export_environment_variables: true | |
- name: Index | |
run: cd main; set -x; python -m hatch run py-wtf index-since --since "$(date -d '1hour ago' '+%Y-%m-%d %H:%M:%S')" ../pages/docs/_index | |
- name: commit | |
run: | | |
cd pages | |
git config user.name "github-actions[bot]" | |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git add . | |
git commit -am 'Auto-generated index' | |
git push |