name: Cache on: push: paths: - .github/workflows/cache.yml schedule: - cron: "0 */6 * * *" # every 6 hours concurrency: group: cache cancel-in-progress: true permissions: contents: read jobs: update: if: startsWith(github.repository, 'Homebrew/') strategy: matrix: os: - macos-11.0 - 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@v3 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'