-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (55 loc) · 2.38 KB
/
Copy pathupdate-readme.yml
File metadata and controls
56 lines (55 loc) · 2.38 KB
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
name: "Cronjob"
on:
schedule:
- cron: '0 8,13,18,21 * * *'
push:
branches:
- 'main'
workflow_dispatch:
jobs:
update-readme-with-blog:
name: Update this repo's README with latest blog posts
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Pull in eplus.dev posts
uses: ePlus-DEV/blog-post-workflow@v1.0.1
with:
retry_count: 2
feed_list: "https://hub.eplus.dev/rss"
committer_email: "h250694@gmail.com"
commit_message: Get blog posts
readme_path: ./profile/templates/README.md.tpl
rand_seed: "hoangsvit"
date_format: 'UTC: yyyy-mm-dd'
template: "- $randomEmoji(💯,🔥,💫,🚀,🌮,📝,🥳,💻,🧰,🏊,🥰,🧐,🤓,😎,🥸,🤩,🤗,🤔,🫣,🤭,🤠,👹,👺,🤡,🤖,🎃,😺,🫶,👍,💪,💄,👀,🧠,🧑🏫,👨🏫,💂,🧑💻,🥷,💃,🕴,💼,🎓,🐻,🐵,🙉,🦄,🦆,🦅,🦍,🦣,🐘,🦒,🦏,🐎,🦩,🐲,🌝,🌜,🌏,🌈,🌊,🎬,🎭,🚀,🚦,⛽️,🗽,🎡,🌋,🌁,💡,🕯,🪜,🧰,⚗️,🔭,🪄,🎊,🎉) [$title]($url) -$date $newline"
max_post_count: 15
update-weather:
permissions: write-all
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: '1.21.0'
- name: Prepare
run: |
export PATH=$PATH:$(go env GOPATH)/bin
mkdir profile/.tmp
- name: Collect weathers
run: |
go install github.com/ePlus-DEV/weather-forecast@v1.0.7
weather-forecast update-weather --days=3 --city="Ho Chi Minh City" --weather-api-key="${{ secrets.WEATHER_API_KEY }}" --template-file='profile/templates/weathers.md.tpl' --out-file='profile/.tmp/weathers.md.tpl'
- name: Merge templates
run: |
git pull
go install github.com/ePlus-DEV/merge-templates@v1.0.1
merge-templates profile/README.md 'profile/templates/README.md.tpl' 'profile/.tmp/weathers.md.tpl'
- name: Commit
run: |
git config user.name "David Nguyen"
git config user.email h250694@gmail.com
git add .
git commit -m "update README.md ($(TZ="Asia/Ho_Chi_Minh" date +'%Y-%m-%d %H:%M:%S'))"
git push origin main