diff --git a/.github/workflows/scheduled.yml b/.github/workflows/scheduled.yml new file mode 100644 index 000000000..dbba3c4a2 --- /dev/null +++ b/.github/workflows/scheduled.yml @@ -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 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c5a410297..06e958290 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 diff --git a/Gemfile.lock b/Gemfile.lock index 16b3083b0..a8e0065cc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -249,4 +249,4 @@ DEPENDENCIES yard BUNDLED WITH - 2.0.1 + 1.17.2