build-site #110
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-site | |
| on: | |
| push: | |
| branches: [main] | |
| schedule: | |
| - cron: "0 4 * * *" # nightly 04:00 UTC — refreshes stars + last-commit dates | |
| repository_dispatch: | |
| # Opt-in instant refresh — an app repo POSTs this on manifest push. | |
| # Snippet + the cross-repo PAT it needs: see README "Instant refresh". | |
| types: [manifest-changed] | |
| workflow_dispatch: {} | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: build-site | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| # full history so the auto-commit can push back without a shallow fetch | |
| fetch-depth: 0 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install builder deps | |
| run: pip install --no-cache-dir jinja2 httpx | |
| - name: Regenerate per-app pages | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: python build/build_apps.py | |
| - name: Commit if changed | |
| run: | | |
| if [[ -z "$(git status --porcelain apps/)" ]]; then | |
| echo "no changes" | |
| exit 0 | |
| fi | |
| git config user.name "mobius-os-bot" | |
| git config user.email "bot@mobius-os.github.io" | |
| git add apps/ | |
| git commit -m "build: auto-regenerated app pages" | |
| git push |