using github actions to build feeds after commit to master and 3 times a day

15 views
Skip to first unread message

infominer

unread,
May 12, 2020, 9:55:52 AM5/12/20
to wwwmake
his was my first github action and I'm really stoked about how (relatively) easy it was. You should be able to copy this and use it in your project to get Pluto running and requiring minimal intervention on your part :D



           name: Ruby
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
- cron: '* 3,11,19 * * *'

jobs:
test:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@ec106b438a1ff6ff109590de34ddc62c540232e0
with:
ruby-version: 2.6
- name: Install dependencies
run: sudo apt-get install libsqlite3-dev && gem install pluto
- name: build reader
run: pluto b planetid.ini -t planetid -o docs
- name: Deploy Files
run: |
git remote add gh-token "https://github.com/didecentral/planetid-reboot.git"
git config user.name "github-actions[bot]" # I use the GitHub Actions bot here.
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add .
git commit -a -m "update feeds"
git push gh-token master



infominer

unread,
May 20, 2020, 10:50:11 AM5/20/20
to wwwmake
I'm new to cron syntax.. so I messed up and accidentally made it run every minute of those hours and every pull\push.. that little bot was running wild...:

- cron: '* 3,11,19 * * *'
          
that needed to be '0 3,11,19 * * *'  so it only runs at the beginning of those hours...

I may end up changing it to hourly.... and maybe some other tweaks... so if you land on this forum and think this is what you were looking for, maybe wanna check the source to see it's evolution.
Reply all
Reply to author
Forward
0 new messages