Skip to content

Commit

Permalink
ci: use setup node cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Sceat committed Jul 2, 2024
1 parent 4d6627e commit 841af85
Showing 1 changed file with 25 additions and 33 deletions.
58 changes: 25 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,18 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
- name: Set up Node.js and install dependencies with cache
uses: actions/setup-node@v4
with:
node-version: 20

- name: Restore Node.js modules cache
id: cache-node-modules-restore
uses: actions/cache/restore@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm install
if: steps.cache-node-modules-restore.outputs.cache-hit != 'true'
cache: 'npm'
cache-dependency-path: |
**/package-lock.json
**/package.json
- name: Install Vercel CLI
run: npm install -g vercel

- name: Save Node.js modules cache
id: cache-node-modules-save
uses: actions/cache/save@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/package.json') }}

deploy-mainnet:
needs: install
runs-on: ubuntu-latest
Expand All @@ -51,13 +35,17 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Restore Node.js modules cache
uses: actions/cache/restore@v4
- name: Set up Node.js and install dependencies with cache
uses: actions/setup-node@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-node-
node-version: 20
cache: 'npm'
cache-dependency-path: |
**/package-lock.json
**/package.json
- name: Install Vercel CLI
run: npm install -g vercel

- name: Pull Vercel project settings (Production)
run: vercel pull --scope=aresrpg --yes --environment=production --token ${{ secrets.VERCEL_TOKEN }}
Expand Down Expand Up @@ -86,13 +74,17 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Restore Node.js modules cache
uses: actions/cache/restore@v4
- name: Set up Node.js and install dependencies with cache
uses: actions/setup-node@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-node-
node-version: 20
cache: 'npm'
cache-dependency-path: |
**/package-lock.json
**/package.json
- name: Install Vercel CLI
run: npm install -g vercel

- name: Pull Vercel project settings (Preview)
run: vercel pull --scope=aresrpg --yes --environment=preview --token ${{ secrets.VERCEL_TOKEN }}
Expand Down

0 comments on commit 841af85

Please sign in to comment.