forked from dsp-testing/android-patterns
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (49 loc) 路 1.72 KB
/
opengraph-card.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
52
53
54
55
56
57
name: Generate OpenGraph Card
on:
workflow_dispatch:
jobs:
generate-opengraph-card:
env:
BASE_PATH: https://og-image.now.sh
QUERY_PATH: _**Android%20Design%20patterns**_%3Cbr%3E_@AlexRogalskiy/android4you_
THEME: light
MARKDOWN_ENABLED: 1
FONT_SIZE: 75px
IMAGES_HEIGHT: "200, 200"
IMAGES: "https://assets.vercel.com/image/upload/front/assets/design/vercel-triangle-black.svg, https://simpleicons.org/icons/github.svg"
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Create OpenGraph card
run: |
IFS=', '
full_path="${BASE_PATH}/${QUERY_PATH}"
full_path="${full_path}?theme=${THEME}"
full_path="${full_path}&md=${MARKDOWN_ENABLED}"
full_path="${full_path}&fontSize=${FONT_SIZE}"
read -r -a array <<< "$IMAGES"
for i in "${array[@]}"
do
full_path="${full_path}&images=$i"
done
read -r -a array <<< "$IMAGES_HEIGHT"
for i in "${array[@]}"
do
full_path="${full_path}&heights=$i"
done
echo "$full_path"
curl "$full_path" > ./images/opengraph-card.png
shell: bash
- name: Commit update
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: master
skip_dirty_check: true
commit_message: "docs: updates on OpenGraph card\n\n Added OpenGraph card"
commit_options: '--no-verify --signoff'
commit_user_name: GitHub Bot
commit_user_email: github-actions@nullables.io
commit_author: GitHub Bot <github-actions@nullables.io>