Cronjob #39208
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Cronjob" | |
on: | |
schedule: | |
- cron: '*/5 * * * *' | |
push: | |
branches: | |
- 'main' | |
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://eplus.dev/rss.xml" | |
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 |