File tree Expand file tree Collapse file tree 1 file changed +52
-0
lines changed Expand file tree Collapse file tree 1 file changed +52
-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
+ cd CircuitPython_Library_Screenshot_Maker
39
+ env LEARN_GUIDE_REPO=../ python3 ./create_requirement_images.py
40
+
41
+ - name : Commit updates
42
+ run : |
43
+ cd CircuitPython_Library_Screenshot_Maker/generated_images
44
+ git config --global user.name "${GITHUB_ACTOR} (github actions cron)"
45
+ git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
46
+ git config --global init.defaultBranch main
47
+ git init
48
+ for i in *.png; do echo "<a href=\"$i\">$i</a><br>"; done > index.html
49
+ git add *.png index.html
50
+ git remote add origin https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
51
+ if git commit -m"update images"; then git push -f origin HEAD:folder-images; fi
52
+
You can’t perform that action at this time.
0 commit comments