Skip to content

Commit

Permalink
Add scheduled regeneration CI jobs
Browse files Browse the repository at this point in the history
This mirrors what Homebrew/formulae.brew.sh does and allows the removal
of the push job from Homebrew/brew.
  • Loading branch information
MikeMcQuaid committed Jun 12, 2020
1 parent eb26b56 commit 456ed45
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 3 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/scheduled.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Scheduled regeneration
on:
schedule:
# Once every other hour
- cron: '30 */2 * * *'
jobs:
generate:
if: startsWith( github.repository, 'Homebrew/' )
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@master

- name: Set up Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: '2.6'

- name: Install RubyGems
run: |
gem install bundler -v "~>1"
bundle install --jobs 4 --retry 3
- name: Generate site
run: |
git clone --depth=1 https://github.com/Homebrew/brew
bundle exec rake yard build
# commit and push generated files
git add docs
if ! git diff --no-patch --exit-code HEAD -- docs; then
git commit -m "docs: updates from Homebrew/brew" docs
git pull --rebase origin master
git push
fi
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
- name: Set up Ruby
uses: actions/setup-ruby@v1
with:
version: '>=2.3'
ruby-version: '2.6'

- name: Install RubyGems
run: |
gem install bundler
gem install bundler -v "~>1"
bundle install --jobs 4 --retry 3
- name: Generate site
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -249,4 +249,4 @@ DEPENDENCIES
yard

BUNDLED WITH
2.0.1
1.17.2

0 comments on commit 456ed45

Please sign in to comment.