Skip to content

Commit

Permalink
update travis and github actions caching
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismclarke committed May 4, 2021
1 parent 6b0100e commit 2e47332
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
restore-keys: |
${{ runner.os }}-yarn-
- name: Install npm dependencies
run: yarn install
run: yarn install --immutable
- name: Build for Preview
run: npm run build
env:
Expand Down
15 changes: 11 additions & 4 deletions .github/workflows/reset-staging-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Reset Staging Site
on:
# Run weekly on a Sunday at 02:00
schedule:
- cron: '0 0 * * SUN'
- cron: "0 0 * * SUN"
# Allow the script to be triggered directly from GitHub
workflow_dispatch:
jobs:
Expand All @@ -21,13 +21,20 @@ jobs:
uses:
google-github-actions/setup-gcloud@master
# skipping setting a service account here as we'll load from json during script
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
# Setup yarn 2 cache: https://github.com/actions/cache/blob/main/examples.md#node---yarn
- name: Setup Cache
uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install npm dependencies
run: yarn install
run: yarn install --immutable
- name: Install global dependencies
run: npm i -g firebase-tools ts-node
- name: Populate service account json
Expand Down
7 changes: 3 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
language: node_js
node_js:
- '12'
- "12"
dist: xenial
cache:
# cache both yarn (.cache) and npm (for global installs)
yarn: true
directories:
- ~/.cache
- ~/.npm
- ./.yarn/cache
addons:
chrome: stable
firefox: latest
Expand All @@ -25,7 +24,7 @@ env:
- DEBUG=True
- MOZ_HEADLESS=1
install:
- yarn install --frozen-lockfile --silent
- yarn install --immutable
# add the current github branch as an environment variable
before_script:
- echo "MATRIX=$MATRIX_VAR"
Expand Down

0 comments on commit 2e47332

Please sign in to comment.