Skip to content

Commit

Permalink
GitHub Actions cleanup
Browse files Browse the repository at this point in the history
- only attempted scheduled job on `push` (where secrets are around)
- use more Homebrew actions
- fix `pull_request: []` warning
- use `@main` actions
  • Loading branch information
MikeMcQuaid committed Aug 18, 2020
1 parent acd6589 commit 14b625d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 14 deletions.
33 changes: 22 additions & 11 deletions .github/workflows/scheduled.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Scheduled regeneration
on:
pull_request:
push:
paths:
- .github/workflows/scheduled.yml
schedule:
Expand All @@ -12,10 +12,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@master
uses: actions/checkout@main
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master

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

Expand All @@ -24,18 +31,22 @@ jobs:
gem install bundler -v "~>1"
bundle install --jobs 4 --retry 3
- name: Configure Git user
uses: Homebrew/actions/git-user-config@master
with:
username: BrewTestBot

- name: Generate site
run: |
git clone --depth=1 https://github.com/Homebrew/brew
bundle exec rake yard build
git checkout -b master
# commit and push generated files
git add docs
ln -s $(brew --repo) brew
bundle exec rake yard build
if ! git diff --no-patch --exit-code HEAD -- docs; then
git config --global user.name "BrewTestBot"
git config --global user.email "[email protected]"
git add docs
git commit -m "docs: updates from Homebrew/brew" docs
git pull --rebase origin master
git push
fi
- name: Push commits
uses: Homebrew/actions/git-try-push@master
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ name: GitHub Actions CI
on:
push:
branches: master
pull_request: []
pull_request:
jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@master
uses: actions/checkout@main

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

Expand Down

0 comments on commit 14b625d

Please sign in to comment.