-
Notifications
You must be signed in to change notification settings - Fork 3
51 lines (40 loc) · 1.2 KB
/
examples.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: examples
on:
push:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
env:
PYTHONUNBUFFERED: "1"
FORCE_COLOR: "1"
jobs:
examples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: extractions/setup-just@v1
- uses: actions/setup-python@v5
with:
python-version: "3.8"
cache: "pip"
allow-prereleases: true
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-dev.lock
- name: Setup Git
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "actions@users.noreply.github.com"
- name: Generate examples
run: |
just generate-examples
- name: Get SHA of push commit
id: shortsha
run: echo "shortsha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Commit and push if examples have changed
run: |-
git add -A
git commit -m "Regenerated examples for ${{ steps.shortsha.outputs.shortsha }}" || exit 0
git push