Scheme submission: Ni #86
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: Generate website in PR | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - 'src/**' | |
| - 'db/**' | |
| - 'pyproject.toml' | |
| - '.python-version' | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| fetch-depth: 10 | |
| - uses: marceloprado/has-changed-path@v1.0.1 | |
| id: changed-front | |
| with: | |
| paths: src/ pyproject.toml .python-version | |
| - name: Install the latest version of rye | |
| uses: eifinger/setup-rye@v2 | |
| - name: Sync rye | |
| run: rye sync --all-features | |
| - name: Rebuild website | |
| if: steps.changed-front.outputs.changed == 'true' || contains(github.event.pull_request.labels.*.name, 'rebuild') | |
| run: rye run rebuild | |
| - name: Build new pages | |
| if: steps.changed-front.outputs.changed == 'false' && !contains(github.event.pull_request.labels.*.name, 'rebuild') | |
| run: rye run build | |
| - name: Commit files | |
| run: | | |
| git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git config --local user.name "github-actions[bot]" | |
| git add . | |
| git commit -a -m "Update website." | |
| - name: Push changes | |
| uses: ad-m/github-push-action@master | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| branch: ${{ github.head_ref }} |