From b8c5c2a2cea2020deb6312f1b4c811ce01a8e14b Mon Sep 17 00:00:00 2001 From: Timothy Gonzalez <105177619+Timothy-Gonzalez@users.noreply.github.com> Date: Mon, 30 Oct 2023 19:02:27 -0500 Subject: [PATCH] Cache dependencies in deploy workflows (#111) This will reduce time spent installing dependencies from ~40s -> ~10s by caching. --- .github/workflows/deploy-preview.yml | 8 ++++++-- .github/workflows/deploy-prod.yml | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 8c040726..9da8fb68 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -12,8 +12,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Install Vercel CLI - run: npm install --global vercel@latest + - uses: actions/setup-node@v3 + with: + node-version: 18 + cache: 'yarn' + - name: Install modules + run: yarn - name: Pull Vercel Environment Information run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} - name: Build Project Artifacts diff --git a/.github/workflows/deploy-prod.yml b/.github/workflows/deploy-prod.yml index 04279949..11af0f65 100644 --- a/.github/workflows/deploy-prod.yml +++ b/.github/workflows/deploy-prod.yml @@ -11,8 +11,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Install Vercel CLI - run: npm install --global vercel@latest + - uses: actions/setup-node@v3 + with: + node-version: 18 + cache: 'yarn' + - name: Install modules + run: yarn - name: Pull Vercel Environment Information run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} - name: Build Project Artifacts