homebrew-cask/.github/workflows/cache.yml

54 lines
1.4 KiB
YAML

name: Cache
on:
push:
branches:
- debug-cache
schedule:
- cron: '0 */6 * * *' # every 6 hours
jobs:
cancel-previous-runs:
if: startsWith(github.repository, 'Homebrew/')
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: n1hility/cancel-previous-runs@953c92201f368370112ea2754545cb4468d89f12
with:
token: ${{ secrets.GITHUB_TOKEN }}
update:
if: startsWith(github.repository, 'Homebrew/')
strategy:
matrix:
os:
- macos-latest
- ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
with:
test-bot: false
# Workaround until the `cache` action uses the changes from
# https://github.com/actions/toolkit/pull/580.
- name: Unlink workspace
run: |
rm "${GITHUB_WORKSPACE}"
mkdir "${GITHUB_WORKSPACE}"
- name: Cache Homebrew Gems
id: cache
uses: actions/cache@v2
with:
path: ${{ steps.set-up-homebrew.outputs.gems-path }}
key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
restore-keys: ${{ runner.os }}-rubygems-
- name: Install Homebrew Gems
id: gems
run: brew install-bundler-gems
if: steps.cache.outputs.cache-hit != 'true'