File tree Expand file tree Collapse file tree 2 files changed +55
-0
lines changed Expand file tree Collapse file tree 2 files changed +55
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Generate folder images
2
+
3
+ on :
4
+ schedule :
5
+ - cron : ' 0 10 * * *'
6
+ workflow_dispatch :
7
+ push :
8
+ branches : [master]
9
+
10
+ concurrency :
11
+ group : folder-images
12
+ cancel-in-progress : true
13
+
14
+ jobs :
15
+ update-images :
16
+ runs-on : ubuntu-20.04
17
+ steps :
18
+ - name : Dump GitHub context
19
+ env :
20
+ GITHUB_CONTEXT : ${{ toJson(github) }}
21
+ run : echo "$GITHUB_CONTEXT"
22
+
23
+
24
+
25
+ - name : Set up Python 3.9
26
+ uses : actions/setup-python@v1
27
+ with :
28
+ python-version : 3.9
29
+
30
+ - name : Checkout screenshot maker
31
+ run : git clone --depth=1 https://github.com/circuitpython/CircuitPython_Library_Screenshot_Maker
32
+
33
+ - name : Install dependencies
34
+ run : pip install -r CircuitPython_Library_Screenshot_Maker/requirements.txt
35
+
36
+ - name : Generate images
37
+ run : |
38
+ find libraries -pattern "libraries/*/examples/*.py" -exec python3 CircuitPython_Library_Screenshot_Maker/create_requirement_images_bundle.py {} +
39
+
40
+ - name : Commit updates
41
+ run : |
42
+ cd generated_images
43
+ git config --global user.name "${GITHUB_ACTOR} (github actions cron)"
44
+ git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
45
+ git config --global init.defaultBranch main
46
+ git init
47
+ for i in *.png; do echo "<a href=\"$i\">$i</a><br>"; done > index.html
48
+ git add *.png index.html
49
+ git remote add origin https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
50
+ if git commit -m"update images"; then git push -f origin HEAD:folder-images; fi
51
+
Original file line number Diff line number Diff line change 2
2
* zip
3
3
.env
4
4
bundles
5
+ CircuitPython_Library_Screenshot_Maker /
5
6
.DS_Store
7
+ generated_images /
8
+ latest_bundle_data.json
9
+ latest_bundle_tag.json
You can’t perform that action at this time.
0 commit comments