must run on pushes to make cache warm (#33491)

This commit is contained in:
Peter Bengtsson 2022-12-14 15:24:52 +01:00 коммит произвёл GitHub
Родитель 0c1e83dccd
Коммит f36a378753
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 58 добавлений и 7 удалений

48
.github/workflows/keep-caches-warm.yml поставляемый Normal file
Просмотреть файл

@ -0,0 +1,48 @@
name: Keep caches warm
# **What it does**: Makes sure the caching of ./node_modules and ./.next
# is kept warm for making pull requests more rapid.
# **Why we have it**: A PR workflow that depends on caching can't reuse a
# cached artifact acorss PRs unless it also runs on `main`.
# **Who does it impact**: Docs engineering, open-source engineering contributors.
on:
workflow_dispatch:
push:
branches:
- main
permissions:
contents: read
jobs:
keep-caches-warm:
if: github.repository == 'github/docs-internal' || github.repository == 'github/docs'
runs-on: ${{ fromJSON('["ubuntu-latest", "ubuntu-20.04-xl"]')[github.repository == 'github/docs-internal'] }}
steps:
- name: Check out repo
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
- name: Cache node_modules
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('package*.json') }}
- name: Setup node
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516
with:
node-version: '16.17.0'
cache: npm
- name: Install dependencies
run: npm install --prefer-offline --no-audit --ignore-scripts
- name: Cache nextjs build
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7
with:
path: .next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('package*.json') }}
- name: Build
run: npm run build

2
.github/workflows/link-check-daily.yml поставляемый
Просмотреть файл

@ -27,7 +27,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516
with:
node-version: '16.15.0'
node-version: '16.17.0'
cache: npm
- name: Install dependencies

15
.github/workflows/link-check-on-pr.yml поставляемый
Просмотреть файл

@ -7,9 +7,6 @@ name: 'Link Checker: On PR'
on:
workflow_dispatch:
merge_group:
push:
branches:
- main
pull_request:
permissions:
@ -31,14 +28,20 @@ jobs:
- name: Checkout
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
- name: Cache node_modules
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('package*.json') }}
- name: Setup node
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516
with:
node-version: '16.15.0'
node-version: '16.17.0'
cache: npm
- name: Install
run: npm ci --ignore-scripts
- name: Install dependencies
run: npm install --prefer-offline --no-audit --ignore-scripts
- name: Figure out which docs-early-access branch to checkout, if internal repo
if: ${{ github.repository == 'github/docs-internal' }}