File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Generate OpenGraph Card
2+
3+ on :
4+ workflow_dispatch :
5+
6+ jobs :
7+ generate-opengraph-card :
8+ env :
9+ BASE_PATH : https://og-image.now.sh
10+ QUERY_PATH : _**Java%20Design%20patterns**_%3Cbr%3E_@AlexRogalskiy/java4you_
11+ THEME : light
12+ MARKDOWN_ENABLED : 1
13+ FONT_SIZE : 75px
14+ IMAGES_HEIGHT : " 200, 200"
15+ IMAGES : " https://assets.vercel.com/image/upload/front/assets/design/vercel-triangle-black.svg, https://simpleicons.org/icons/github.svg"
16+ runs-on : ubuntu-latest
17+ steps :
18+ - name : Checkout Code
19+ uses : actions/checkout@v2
20+ with :
21+ fetch-depth : 0
22+
23+ - name : Create OpenGraph card
24+ run : |
25+ IFS=', '
26+
27+ full_path="${BASE_PATH}/${QUERY_PATH}"
28+ full_path="${full_path}?theme=${THEME}"
29+ full_path="${full_path}&md=${MARKDOWN_ENABLED}"
30+ full_path="${full_path}&fontSize=${FONT_SIZE}"
31+
32+ read -r -a array <<< "$IMAGES"
33+ for i in "${array[@]}"
34+ do
35+ full_path="${full_path}&images=$i"
36+ done
37+
38+ read -r -a array <<< "$IMAGES_HEIGHT"
39+ for i in "${array[@]}"
40+ do
41+ full_path="${full_path}&heights=$i"
42+ done
43+
44+ echo "$full_path"
45+ curl "$full_path" > ./images/opengraph-card.png
46+ shell : bash
47+
48+ - name : Commit update
49+ uses : stefanzweifel/git-auto-commit-action@v4
50+ with :
51+ branch : master
52+ skip_dirty_check : true
53+ commit_message : " docs: updates on OpenGraph card\n\n Added OpenGraph card"
54+ commit_options : ' --no-verify --signoff'
55+ commit_user_name : GitHub Bot
56+ commit_user_email : github-actions@nullables.io
57+ commit_author : GitHub Bot <github-actions@nullables.io>
You can’t perform that action at this time.
0 commit comments